MySQL Forums
Forum List  »  Stored Procedures

Re: Simple stored procedure question
Posted by: Peter Brawley
Date: January 12, 2006 03:54PM

Hi Les,

Nice try :-). MySQL insists that we prepare from a user variable, so it will give you a syntax error if you try to prepare directly from a concat() call.

User vars (unlike LOCAL vars) are auto-declared when you SET them, likewise stmts when you prepare them eg...

delimiter |
create procedure tst()
begin
set @s = 'select * from foo';
prepare s from @s;
execute s;
deallocate prepare s;
end;
|
delimiter |

PB

Options: ReplyQuote


Subject
Views
Written By
Posted
2436
January 12, 2006 02:06PM
1372
January 12, 2006 03:22PM
1431
January 12, 2006 03:37PM
Re: Simple stored procedure question
1431
January 12, 2006 03:54PM
1529
January 12, 2006 04:03PM
1544
January 12, 2006 04:19PM
1500
January 12, 2006 04:46PM
1483
January 12, 2006 05:21PM
1390
January 13, 2006 10:29AM
1461
January 13, 2006 12:19PM


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.