Subject Re: [firebird-support] Re: ORDER BY not working??
Author Helen Borrie
At 11:25 PM 9/04/2008, dkeith2 wrote:
>Thanks Helen. Gee, I didn't know that I wrote 'monumental' procs...
>just the normal data processing stuff. I'll try to heed your advice in
>the future.
>
>Monumental.....

there ya go! ;-)



>Anyway when I do an execute statement call how do I deal with single
>quotes within the statement?:
>
>CAST('' AS VARCHAR(12)) AS MERGE_VALUE,
>CAST('N' AS CHAR(1)) AS MERGE_DELETE
>
>Is there a particular escape character that needs to be used when
>quoting 'quote' characters?

Indeed there is: you escape an apostrophe with an apostrophe. But you don't need to cast 'N' as char, it's already char by its creation as a single-character derived field constant.

So, at this point in building you statement, you would have sthg like

ststring = ststring || ', cast ('''' as varchar(12)) as merge_value';
ststring = ststring || ', ''N'' as MERGE_DELETE';

(making sure those are pairs of apostrophes, not double-quotes!)

./heLen