I have a dozen tables and I need to perform the same operations on them so I thought I'd create a stored procedure and just pass the table name, column name.

I was hoping it would take the parameters and substitute that in the code. So it looks like this:

create procedure RankStock(IN TableNameIn CHAR(20),
                           IN ColNameIn   CHAR(20))
begin
  select ColNameIn from TableNameIn order by ColNameIn;
end;

Of course this produces errors because it doesn't like the TableNameIn in the select statement. So from all this I have to assume I can't build a Select statement by using passed parameters. Is that right?

TIA
Mike
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to