I have a textbox and Iam entering multiple Id's separated by commas(say abcd,xyz1,pqrs) and while passing to the fex file I need the single quotes to be around the ID's(say something like select * from table where ID in ('abcd','xyz1','pqrs')...
Could anyone please help me on how to do this.
Thanks a lot in advance!
Regards, ApoorvaThis message has been edited. Last edited by: <Kathryn Henning>,
November 22, 2014, 05:40 AM
Twanette
Hi, Perhaps you can use the STRREP function? Concatenate a single quote to the beginning and end, then replace the comma with quote-comma-quote.
STRREP: Replacing Character Strings The STRREP replaces all instances of a specified string within a source string. It also supports replacement by null strings.
The DEFAULT has to have quotes around and no semi-colon at the end, as the comma splits the value and the semi-colon is not required. The first TRUNCATE may be useful when value comes from an HTML form. The 1000/A1000 length can be any value that would work with your process.
Alan. WF 7.705/8.007
November 24, 2014, 08:40 AM
info4pal
Hi,
Thanks a lot Alan and everyone for your help. It worked!
Regards
November 24, 2014, 09:18 AM
stur0063
Here's a little explanation of the 4 ticks:
One tick starts the string literal. Two ticks escapes it - implying you want to print a single tick - as opposed to ending the string. The very last tick closes the string literal.