home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.oracle
- Path: sparky!uunet!mcsun!ieunet!tcdcs!vax1.tcd.ie!nafallon
- From: nafallon@vax1.tcd.ie
- Subject: Dynamic SQL - PREPARE
- Message-ID: <1992Nov11.191651.1@vax1.tcd.ie>
- Lines: 24
- Sender: usenet@cs.tcd.ie (NN required at ashe.cs.tcd.ie)
- Nntp-Posting-Host: vax1.tcd.ie
- Organization: Trinity College Dublin
- Date: Wed, 11 Nov 1992 19:16:51 GMT
- Lines: 24
-
- 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;
- VARCHAR select_stmt[200];
- EXEC SQL END DECLARE SECTION;
-
- sprintf(select_stmt.arr,"SELECT song FROM rush WHERE album = 'Presto'");
-
- I have tried all sorts of combinations of VARCHARs and char's as well as using
- variables for column names but the same error always results.
- Any pointers as to why this is happening would be greatly appreciated.
-
- Niall Fallon
- fallon@mee.tcd.ie
-