I am getting the error that "TABLENAME" does not exist. How do I get it to substitute the value stored in TABLENAME, and not the literal string?
begin
declare v_max int unsigned default 1; declare v_counter int unsigned default 21; declare TABLENAME text;
start transaction; while v_counter <= v_max do SET TABLENAME = CONCAT('wp_',v_counter, '_options'); INSERT INTO TABLENAME VALUES ('309', '0', 'statpress_mincap', 'edit_posts', 'yes'); set v_counter=v_counter+1; end while; commit; END
Thanks, Adam
-- Adam Gerson Co-Director of Technology Columbia Grammar and Prep School phone. 212-749-6200 ex. 321 fax. 212-428-6806 agerson@cgps.org http://www.cgps.org
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=listsearcharchive@lassosoft.com
Oct 04
Peter Brawley Re: Variables in stored procedure
Oct 04, 2011; 16:27
Peter Brawley
Re: Variables in stored procedure
Oct 04
luiz rodrigo mottin Re: Variables in stored procedure
Oct 04, 2011; 18:29
luiz rodrigo mottin
Re: Variables in stored procedure
Oct 04
Adam Gerson Re: Variables in stored procedure
Oct 04, 2011; 18:00
Adam Gerson
Re: Variables in stored procedure
Oct 04
luiz rodrigo mottin Re: Variables in stored procedure
Oct 04, 2011; 19:53
luiz rodrigo mottin
Re: Variables in stored procedure
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!