Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> using Cursors in Pro C/C++
I'd like to use a cursor for parsing the result of dynamic generated
statements.
The following I coded in Pro C/C++ like that one I found in documentation:
int oraCursorInit(const char *stmt, const char *conn)
{
VARCHAR dynstmt[100000];
strcpy(dynstmt.arr, stmt);
dynstmt.len=strlen(dynstmt.arr);
EXEC SQL AT :conn PREPARE sql_stmt FROM :dynstmt; EXEC SQL AT :conn DECLARE arcur CURSOR FOR sql_stmt; EXEC SQL AT :conn OPEN arcur;
int oraCursorNext(char *objid, const char *conn)
{
VARCHAR id[256];
EXEC SQL AT :conn FETCH arcur INTO :id;
...
}
What is 'arcur' global or what else ?
If I call this function by different connection id's ('conn') without
closing the cursor do I overwrite 'arcur' or is there a "cursor-management"
behind this that differs between connections ?
How can I avoid this situation ? By context-variables ?
Thanks for answers.
Matthias Späth
Received on Mon Sep 27 1999 - 07:11:22 CDT
![]() |
![]() |