MySQL Forums
Forum List  »  Stored Procedures

Re: Variables in Queries (Stored Procedures)
Posted by: Rafal Zdziech
Date: January 12, 2006 08:36AM

Try this :)


SET @tbname="tbname";

SELECT concat('SELECT ','a',' FROM', @tbname) INTO @VAR;

PREPARE STMT FROM @VAR;
EXECUTE STMT;

Fell free to use....

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Variables in Queries (Stored Procedures)
1410
January 12, 2006 08:36AM


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.