Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> using Cursors in Pro C/C++

using Cursors in Pro C/C++

From: Matthias Späth <matthias.spaeth_at_optimum-gmbh.de>
Date: Mon, 27 Sep 1999 14:11:22 +0200
Message-ID: <7snmg0$1up7$1@news.karlsruhe.punkt.de>


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;

 return 0;
}

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US