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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

175 views 0 4
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