MySQL Forums
Forum List  »  Microsoft SQL Server

Re: Dynamic SQL in Stored procudures
Posted by: Per-Erik Martin
Date: November 18, 2004 10:56AM

There's no "EXEC" of a string currently (there might be in the future though).
But it's possible to work around with prepared statements:

delimiter //;
create procedure tst()
begin
prepare stmp from 'INSERT INTO LOGG SELECT PFILE_Filename FROM PFILE_FILE';
execute stmp;
deallocate prepare stmp;
end//
delimiter ;//

But beware, prepared statement handles are session global, so it must be used with some care.

Options: ReplyQuote


Subject
Written By
Posted
Re: Dynamic SQL in Stored procudures
November 18, 2004 10:56AM


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.