Dynamic SQL - PREPARE
Date: Wed, 11 Nov 1992 19:16:51 GMT
Message-ID: <1992Nov11.191651.1_at_vax1.tcd.ie>
Hi, anybody like to help a struggling Oracler?.
One of our tables has a column listing the other tables to be accessed.
I want to read a table name into a variable and then query that table for some
more data, therefore I have to use Dynamic SQL, but I cannot seem to get past
the PREPARE stage.
The statement: EXEC SQL PREPARE subcat_stmt FROM :select_stmt;
gives the error: ORA-00911: invalid character
select_stmt is created as follows..
EXEC SQL BEGIN DECLARE SECTION;
I have tried all sorts of combinations of VARCHARs and char's as well as using
VARCHAR select_stmt[200];
EXEC SQL END DECLARE SECTION;
sprintf(select_stmt.arr,"SELECT song FROM rush WHERE album = 'Presto'");
Niall Fallon
fallon_at_mee.tcd.ie
Received on Wed Nov 11 1992 - 20:16:51 CET