MySQL Forums
Forum List  »  Microsoft SQL Server

Re: Calling stored procedures ... Dynamic SQL
Posted by: Roland Bouman
Date: June 08, 2006 05:26AM

Hi,


create procedure p()
begin
-- build the string anyway you like
set @stmt := 'create table t(id int)';
prepare stmt from @stmt;
execute stmt;
-- dont forget to deallocate, you'll get ito trouble.
deallocate prepare stmt;
end;


see also:

http://forge.mysql.com/snippets/view.php?id=13

good luck!

Options: ReplyQuote


Subject
Written By
Posted
Re: Calling stored procedures ... Dynamic SQL
June 08, 2006 05:26AM


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.