PocketQuery: How to Escape & in Parameters

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

77 views 0 5
Read article

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