MySQL Forums
Forum List  »  Stored Procedures

Re: Variable as table-name
Posted by: Roland Bouman
Date: December 11, 2005 08:29AM

Slava,

I just found out (thanks Valeriy, see http://bugs.mysql.com/bug.php?id=15666) that there is a slightly more elegant way to deal with SELECT INTO inside prepared statements:

prepare stmt from 'SELECT col1 INTO @col1 FROM table1';

does in fact work, wich is a lot less ugly (i think) than my prior suggestion of

prepare stmt from 'SELECT @col1:=col1 FROM table1';

Also, this solutions does not make the proc return a resultset. Wich is nicer i think.



Edited 1 time(s). Last edit at 12/11/2005 08:30AM by Roland Bouman.

Options: ReplyQuote


Subject
Views
Written By
Posted
37907
December 09, 2005 09:27AM
17494
December 09, 2005 01:41PM
9669
December 10, 2005 07:57AM
Re: Variable as table-name
10228
December 11, 2005 08:29AM
8590
December 12, 2005 07:57AM
8277
December 12, 2005 08:48AM


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.