Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
using replace on a queryText
RoyB1
I have been trying to use a replace function to modify the SQL in the this.queryText
As soon as I add a line like the following in dataset before open
var myQuery = this.queryText;
var newQuery = myQuery.replace(/param1/,"'4','6'");
this.queryText = newQuery ;
Birt complains there is a script error.
If I change the first line to say
var myQuery = "some stuff";
I just get the expected SQL error.
Is queryText a string? If not can I persuade myQuery to do a replace?
Thanks
Find more posts tagged with
Comments
RoyB1
After further trial and error I found this code seems to work.
var myQuery = String(this.queryText)
var newQuery = myQuery.replace(/aparam/,"'4','6'");
this.queryText = newQuery;
vipinag
you saved me a lot of efforts! thanks a lot..