PL/SQL-Variables in SQL string

From: Ralf Steppacher <steppacher_at_gmx.de>
Date: Wed, 11 Aug 1999 08:48:40 +0200
Message-ID: <37B11CC8.2D789382_at_gmx.de>



[Quoted] I tried to implement a package that takes table field names and search criteria as parameters. Depending on the field names and the given content pattern it should delete records from the table. But it seems that PL/SQL can't handle variables in its SQL statements. At least not for a field name in the WHERE clause. I tried to substitute the where clause of a parameterized cursor, but I was always told that my parameter has the wrong type (I tried both CHAR and VARCHAR2).
Simply writing the field name variables into the SQL statement did compile but would not delete anything. It seems to me that the variables were not interpreted.

My question is: How do I pass field names to a stored procedure and use them in a SELECT PK_FIELD FROM TABLE WHERE field_varable = criteria_variable statement?

Thank you in advance!
Ralf Received on Wed Aug 11 1999 - 08:48:40 CEST

Original text of this message