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)
how can I make a string parameter pass to the sql statement in data sets
kohl
Hi,
I have a sql statement, but the where condition is a little long and the condition I wanna design can be chosen from a parameter. So there is a question,
how can I make a string parameter pass to the sql statement in data sets
Thanks.
Find more posts tagged with
Comments
johnw
Use either Property Binding or override the onOpen statement for the data set.
You would use something like the following in the Property Binding for the QueryText property:
sqlText = "Your SQL statement" + params["myParam"]
Or, if you select the dataset, and select the beforeOpen event, use the following script:
var queryText = this.queryText;
var myParam = params["myParam"];
var concatedQuery = queryText + "where " + myParam;
this.queryText = concatedQuery;