How to handle special chars in Query Parameters

In my query I want to request some data from a mysql-database.

The Query is something like the following:

select field1, field2
from table
where field3 = :name

The actual query is more complex but that won't change anything for this example.

My Problem is that the name I am search for consits of characters like &,...

When I add the macro (with active debug) to the page and use 'test1 & test2' as Value for name, the debug information shows that the vaule is cut at the special char.

Debug information.
Query: test
Query parameters: [name=test ]
Query execution time: 49 ms
Template parameters: []

 

How to handle this?

5 answers

1 accepted

This widget could not be displayed.

Hi Lukas! Can you check if this version fixes your issue? Is a pre-release of version 2.0.8.

Hi!

Thanks it is working now with that version.

Great! Can you work with this version for a few days and provide feedback if any errors occurred?

I we see any error, I will report it.

This widget could not be displayed.

Hi Lukas,

You are right, using the "&" character is currently not possible for query parameters. This is definitely something we need to fix soon. I created an issue internally and I'll let you know as soon as it is fixed.

Regards, Felix (Scandio)

This widget could not be displayed.

Hi!

Thanks for the Info, when is it planed to be ready?

Ragards

This widget could not be displayed.

While we're still working on version 2.1, I'm thinking about providing a new minor "hotfix" version for this issue. In that case, you'll have this next week.

This widget could not be displayed.

Hi Lukas!

Bad news: unfortunately I had to roll-back this solution because it caused serious issues in different cases. I'm still searching for a solution for the issue and I'll try to integrate it in our release 2.1 which will be released soon. I would recommend to switch back to the marketplace version and live with the "&" issue for some more time, since the version I gave you might cause issues as soon as you update PocketQuery to the next official version.

I'm really sorry for the inconvenience and I promise I will find a solution for this!

Regards, Felix (Scandio)

Ok, I think I implemented a good solution. Please install PocketQuery 2.1-m8

Hi!

ok, we will try to install it within the next days.

Regards Lukas

Testing 2.1 I have issues with the '&' character when is included in an item within the IN clause...

Can you post your query?

What is not working is ... WHERE Field1 IN (:Filter) ... being the "Filter" a ListOfStrings in which one of the items is 'Backup & Restore'...

I found a work around using the replace function in SQL to replace the '&' by the '-' and then it works!!! but what is stored in the (Oracle) database is the 'Backup & Resore'...

Thanks Felix!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

541 views 7 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you