I installed MySQL 5.0 alpha and tried for my first time stored procedures.
I begin with this:
CREATE PROCEDURE `myfirstproc`(in codx char(16),OUT descr char(50))
BEGIN
select description into descr from artics where cod = codx;
END
then
call myfirstproc("mycod",@retreivedDescription)
select @retreivedDescription
it works!!
Now a little step behind.
I should like to parametrize the table name. How can i do?
I tried somthing like:
CREATE PROCEDURE `myfirstproc`(IN codx char(16), IN TableName char(20), OUT descr char(50))
BEGIN
select description into descr from (MyTableName) where cod = codx;
END
I tried a lot of forms but the 'call myfirstproc' always fall in error.
Can SomeBody help me?
Thanks
Giovanni Caramia
I begin with this:
CREATE PROCEDURE `myfirstproc`(in codx char(16),OUT descr char(50))
BEGIN
select description into descr from artics where cod = codx;
END
then
call myfirstproc("mycod",@retreivedDescription)
select @retreivedDescription
it works!!
Now a little step behind.
I should like to parametrize the table name. How can i do?
I tried somthing like:
CREATE PROCEDURE `myfirstproc`(IN codx char(16), IN TableName char(20), OUT descr char(50))
BEGIN
select description into descr from (MyTableName) where cod = codx;
END
I tried a lot of forms but the 'call myfirstproc' always fall in error.
Can SomeBody help me?
Thanks
Giovanni Caramia