MySQL Stored Procedures Problem bei Übergabeparamter

casiopeia

Grünschnabel
Hallo,

habe folgende Stored Procedure:

CREATE DEFINER=`root`@`localhost` PROCEDURE `Proc_GetTableData`(IN chTableName varchar(30), IN chPrimaryKey varchar(30), IN iMax int)
BEGIN
SELECT * FROM chTableName WHERE chPrimaryKey > iMax;
END


Die SELECT Abfrage liest nicht die Variable chTableName aus sondern sucht in der Tabelle chTableName. Wie kann ich das ändern? Danke schon mal für jede Hilfe!
 
Zurück