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)
question about removing single quotes on string parameter
temphan
Hey,
I just started to learn how to use Birt. Now I have a question and need help.
I setup a parameter A as a string. However, instead of using A as a
value in SQL, I need to use it as the column name.
i.e., in SQL it looks like tablename.? = ?, where A will be used for
the first question mark.
However, Birt will automatically add a pair of single quota on the
A, which cause syntax error (tablename.'A'). Is there any simple way,
rather than write script to use a string parameter without this pair
of single quotes.
Thanks a lot!
Find more posts tagged with
Comments
mwilliams
Hi temphan,
So, you're using a parameter to choose what field from the table to fetch?
temphan
Yes, the parameter decides which column to fetch, so I need to remove the single quotes around the parameter.
temphan
Please help, I need to finis this before Friday. Thanks!
mwilliams
temphan,
Maybe you could use some sort of replace function or substring function in your SQL to remove the ' marks. I have not tested this, so I don't know if it would work or not. Otherwise, building the query in javascript in the dataSet's beforeOpen method may be the way to go.