Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Passing a pointer to a cursor variable between 2 pro*c functions.
Hi,
I have created the following 2 pro*c functions:
DPLsearchNCustomers( ... sql_cursor *p_cursor...) ;
DPLcloseCursor(sql_cursor *p_cursor) ;
The first function allocates memory for the cursor variable and open
the
cursor. The second function closes the cursor. however when I call the
second function to close the cursor I get the following error message:
ORA-01001 : Invalid Cursor.
I don't do a commit between the function calls and I have checked my SGA
to
ensure the cursor is still there before I close it with the second
function.
The following text is DPLclosecursor(sql_cursor *p_cursor);
DPLcloseCursor(sql_cursor *p_cursor)
{
#include <sqlca.h>
EXEC SQL BEGIN DECLARE SECTION ;
sql_cursor *c_cursor = p_cursor;
/*other variables are declared here*/
EXEC SQL END DECLARE SECTION ;
EXEC SQL EXECUTE
BEGIN
IF :c_cursor%ISOPEN = TRUE THEN CLOSE :c_cursor ; ELSE /*other statements are here*/ END IF ;
} Received on Fri Aug 20 1999 - 08:38:15 CDT
![]() |
![]() |