MySQL Forums
Forum List  »  Stored Procedures

Re: Dynamic SQL problem in Store Procedure
Posted by: Mark Rouse
Date: July 18, 2012 05:03AM

Thanks, but I already do. This is my syntax:

set @s= concat('SELECT ID, replace(replace(field_a,''*'',''''),''\''',''\\'''')
FROM table where field_b = ',vVariable,'');

prepare stmt from @s;
execute stmt;
deallocate prepare stmt;

Can anyone tell me what is wrong with it? I wnt to find a single quote (so I escape it with a backslash, and replace it with a backslash and single quote (so I escaped the backslash.

But MySQL tells me there is any error in my syntax. And, I can't see it.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Dynamic SQL problem in Store Procedure
1219
July 18, 2012 05:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.