Hi

 

Is there any way I can pass the reference to a source table to be used
in a SELECT command within a Stored Procedure

 

Something like this....

 

CREATE PROCEDURE `myDB`.`sp_test` (myTable varchar(20))

BEGIN

SELECT * FROM myTable;

END $$

 

This gives error "cannot find Table myDB.myTable

 

I cant find how to pass reference in this context.  If its not possible,
are there any suggestions as to how to create a flexible SP whereby I
can pass the source?

 

I can do it by repeating the main select within a switch case structure
but it doesn't seem a very elegant solution

 

Thanks for looking 

 

Roger Maynard

Somerset UK

Reply via email to