PocketQuery: How to Escape & in Parameters

Tim Miller November 4, 2016

I have a pocket query that I have set up as follows:

 

Statement:

select *

from table(devpromo.PROMO_CONFIGURATION(:promo_code, :promo_sequence, :environment)) a

 

Parameter Types:

param1=String&param2=Integer&param3=String

 

The following Parameters are being submitted via the form.

 

Param1:    FIOS BB & FIOS

Param2:    13

Param3:    CPLMS

 

This is what the debug shows as what was submitted.

Debug information.

Query: PROMO_CONFIG

Query parameters: [environment=CPLMS promo_code=FIOS BB promo_sequence=13 ]

User: Miller, Tim

Page: Promotion Trouble Shooting Inquiries

Query execution time: 2094 ms

Template parameters: []

 

For some reason it is dropping everything from the & on in the Param1. 

 

I've searched through google and atlassian answers and can not find anything except on your blog it mentions the following:

  • Special characters & and = could previously not be used in query parameters.

 

We have version 2.1.2 installed.

 

Any ideas on how I make it so the & is passed through in the string and doesn't cause it to stop at the & in the string?

 

Thanks for any help!

Tim

1 answer

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.
November 5, 2016

Hi Tim,

This has actually been an issue before PQ 2.1. It originated in this post: https://answers.atlassian.com/questions/38382530. But this issue was actually fixed with 2.1 and I cannot reproduce that issue any more. What I tried...

I have a table with countries and one country name is "Trinidad & Tobago". I wrote this query:

SELECT Name, Population
FROM Country
WHERE Name = :Name

In the macro I enter "Trinidad & Tobago" for the parameter "Name". The result is the correct one with the "Trinidad & Tobago" row.

Then, I added your query in the PocketQuery admin:

select *
from table(devpromo.PROMO_CONFIGURATION(:promo_code, :promo_sequence, :environment))

I entered the parameter values as you suggested, but I don't get the behaviour with the cut-off value for promo_code:

image2016-11-5 8:58:10.png

Are you really sure you are running on PocketQuery 2.1.x?

Best, Felix (Scandio)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events