Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to handle special chars in Query Parameters

Lukas Plattner April 12, 2016

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

0 votes
Answer accepted
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2016

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

Lukas Plattner April 22, 2016

Hi!

Thanks it is working now with that version.

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2016

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

Lukas Plattner April 22, 2016

I we see any error, I will report it.

0 votes
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 19, 2016

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)

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2016

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

Lukas Plattner May 25, 2016

Hi!

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

Regards Lukas

Cuto Calleja
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2016

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

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2016

Can you post your query?

Cuto Calleja
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2016

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!

0 votes
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2016

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.

0 votes
Lukas Plattner April 12, 2016

Hi!

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

Ragards

0 votes
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2016

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)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events