Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
SQL query parameters and escape characters
raozmc
The query I want to run explicitly is
SELECT rdata FROM cmt WHERE rqst='123456'
I want the number portion to be a parameter (123456) or the string ('123456')
Basically no matter how I try to construct the query with the parameter and no matter what data types I use I can't get the same behavior as when I hardcode the number into it. Any help would be greatly appreciated.
Ryan
Find more posts tagged with
Comments
mwilliams
Hi Ryan,
You're trying to run a basic query with a basic user entered parameter? If this is correct, you should be able to just say:
SELECT rdata FROM cmt WHERE rqst= ?
Then, you'd just link your dataSet parameter to a report parameter of type integer. Then, your user would be able to enter an integer parameter to limit your dataSet.
Have you done this? Is it not working for you?
raozmc
I'm familiar with how to add parameters to the query and link them to report parameters however no configuration I've tried has worked.
Hardcoding the query to this works
SELECT rdata FROM cmt WHERE rqst='123456'
but this does not
SELECT rdata FROM cmt WHERE rqst=123456
when I run
SELECT rqst FROM cmt
the data appears to be in hex:
C1 C4 D9 C9 C5 D5 D5 C5 ...
C1 C4 D9 C9 C5 D5 D5 C5 ...
C1 C4 D9 C9 C5 D5 D5 C5 ...
the ellipses are actually being displayed by the viewer. I'm not sure if any of this information helps
mwilliams
raozmc,
If you run a query outside of BIRT do you get the same result? You're certain the 'type' on your field is integer or string?
bmuskie
Try to see if this make any difference:
SELECT cast(rqst as char) FROM cmt