MySQL Forums
Forum List  »  Stored Procedures

Can we execute a dynamic sql in a stored procedure,like sqlserver?
Posted by: xiang zou
Date: September 15, 2005 10:12PM

hi all:
i have some problems during developing with mysql
problems below:

Can we execute a dynamic sql in a procedure,like sqlserver?

for example:
in sqlserver,we can make it like this:

declare @sql varchar(4000)
set @sql = "select * from sampleTable where id in '("+@idcollections+")'"
exec (@sql)
........

i use mysql 5.0.12 beta,help me,thanks



Edited 3 time(s). Last edit at 09/17/2005 04:02AM by xiang zou.

Options: ReplyQuote


Subject
Views
Written By
Posted
Can we execute a dynamic sql in a stored procedure,like sqlserver?
8069
September 15, 2005 10:12PM


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.