MySQL Forums
Forum List  »  Stored Procedures

Re: Can I use a dynamic table name in stored procedure
Posted by: Martin Leboeuf
Date: November 14, 2006 02:16PM

Hi !

Thanks for the tip to construct my SQL dynamically with CONCAT(). Modify your SP as follows and it will work:

set @num_v_tmp=-1
set @dyn_sql=CONCAT('select count(*) into @dyn_v_tmp ...');
...
-- and then use @dyn_v_tmp e.g. to set your return variable.

Cheers,

Martin.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Can I use a dynamic table name in stored procedure
6380
November 14, 2006 02:16PM


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.