Re: Escape Sequence!

Re: Escape Sequence!

 

  

Try This..

SET temp_sql = 'SELECT temp FROM temp_tab WHERE temp_fn(t, ''a'') = 2';

Regards

Amit Singal

----- Original Message -----
From: "Ashish Kumar Aggarwal "
<db2udbdba-ezmlmshield-x5051413.[Email address protected]
To: "LazyDBA Discussion" <[Email address protected]
Sent: Friday, August 26, 2005 3:40 PM
Subject: Escape Sequence!


> LeavesHi All
>
> I'm putting my SQL in a String through which I'll PREPARE the Statement
and create a Cursor for that. The problem I'm facing is the my SQL contains
' (Single Quotes) in between which causes the unmatched quotes.
>
> Sample SQL :
>
> DECLARE temp_sql VARCHAR(100);
> DECLARE stmt STATEMENT;
> DECLARE temp_cur CURSOR WITH RETURN TO CALLER FOR stmt
>
> BEGIN
> SET temp_sql = 'SELECT temp FROM temp_tab WHERE temp_fn(t, 'a') = 2';
> END
>
> PREPARE stmt FROM temp_sql;
> OPEN temp_cur;
>
> It gives error the "a is not a recognised procedure of function". Note in
the SELECT Statement there are four ' which are matched as 1-2 and 3-4 with
"a" left stranded in between. How can I overcome this.
>
> Kindly Guide
>
> Ashish
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>



DB2 & UDB email list listserv db2-l LazyDBA home page