Oracle ESQL question
Date: Wed, 8 Dec 1993 20:28:13 GMT
Message-ID: <1993Dec8.202813.29512_at_rossinc.com>
Is it possible to have a variable statement_name and cursor_name in PREPARE, DECLARE, OPEN, etc. ESQL statements???
I'm using dynamic SQL and I'm trying to have multiple cursors opened at the same time.
A snippet of the code follows:
prepare_cursor(char * sql_command, int unique_id) {
EXEC SQL BEGIN DECLARE SECTION;
char * sql_statement;
char statement_name[16];
char cursor_name[16];
EXEC SQL END DECLARE SECTION;
sql_statement = sql_command;
make_unique_statement_name(statement_name, unique_id); make_unique_cursor_name(cursor_name, unique_id);
EXEC SQL PREPARE :statement_name FROM :sql_statement;
EXEC SQL DECLARE :cursor_name CURSOR FOR :statement_name; }
Is this possible?? Is there a work around?? Will I be using OCI?? :-)
Also, is it possible to use macros in DECLARE SECTIONs???
i.e.
#define MAX_STATEMENT_NAME (16)
EXEC SQL BEGIN DECLARE SECTION;
char statement_name[MAX_STATEMENT_NAME];
EXEC SQL END DECLARE SECTION;
Thanks in advance,
Dave
-- ============================================================= David A. Moore | Phone: (415) 593-2500 Ross Systems Inc. | E-mail: davidmo_at_rossinc.comReceived on Wed Dec 08 1993 - 21:28:13 CET