Is this a bug of stored procedure? -
05-10-2006
, 10:13 PM
------=_Part_28545_28079720.1147317200858
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi,
I tried to pass the name of a table into a procedure and use that in a
select statement. Somehow it doesn't work. Here is the code:
create procedure sp3(in tablename varchar(10))
begin
select count(*) from tablename;
end$
When the procedure is called, I got the following error: ERROR 1146 (42S02)=
:
Table 'test.tablename' doesn't exist.
Does anyone know why my code generated an error? Is this a bug?
Thanks,
Tom
------=_Part_28545_28079720.1147317200858-- |