I have a stored procedure which selects from a certain table. This table gets passed to the procedure as a parameter.
SELECT * FROM ParamName
And all it tells me when I try to run it is ‘Table ParamName doesn’t exist.
Any suggestions are greatly appreciated?
I have a stored procedure which selects from a certain table. This table gets
Share
ParamNameby itself would appear to MySQL as a table/field name, which it’s rightly complaining about. If Paramname is a parameter for the stored procedure, you’d have to use@ParamNameto tell MySQL to look for a variable of that name.However, you can’t simply do
mysql doesn’t allow table/fieldnames to be specified via variables. You’ll have to prepare a statement first: