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)
Format sql code in data set Script tab
al91206
Hi,
I have a query that selects a table name in the Script tab of one of my data sets. However the Script will error out if I use formatted sql (more than 1 line) so I need to remove all the lines so the sql runs in one continuous line in order for it to work - is this normal?
Thanks!
Al
Find more posts tagged with
Comments
mwilliams
Hi Al,
Can you explain a little more? Thanks.
al91206
In the beforeOpen tab of my data set - I use this.queryText = " looong sql query here"
That is the sql I would like to format, but if I have any more than 1 line it errors out - so I have to just have one long sql select statement.
I've attached a small screenshot
mwilliams
Al,
Are you meaning that in your script, you're trying to format a long query text so it looks good in your code? Like:
this.queryText = "select * "
+ "from blah "
+ "where blah = blah";
Rather than being on one line, like:
this.queryText = "select * from blah where blah = blah";
al91206
That's right - because what I have to do is formulate the query - then manually remove the lines. Just looking to save myself some work!
Thanks,
Al