Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> fork a process while(sqlca.sqlcode==0)
Hello,
I'm working on a client-server apply under Unix (osf). I'd like to fork a process each time I get a value return by the FETCH. But when I try to fork a process, the cursor is closed?!!? but why??
ORACLE SAYS:
Error: ORA-01001: Invalid cursor
Here is the sample code :
EXEC SQL DECLARE C1 CURSOR FOR SELECT ...
EXEC SQL OPEN C1;
EXEC SQL FETCH C1 INTO :fid, :userid;
while(sqlca.sqlcode==0)
{
printf("fid :%d\n",fid);
/* ********************************************** */
/* if I remove this part of the code it works perfectly */
if (auth_children_count < MAX_AUTH_CHILD)
{
auth_children_count++; if ((pid = fork()) < 0) { perror("Cannot fork a child"); exit(1); } else if (pid == 0) { /*auth_child(fid,userid); */ }
}
/* End code to be removed to make that work. */
/* ********************************************** */
EXEC SQL FETCH C1 INTO :fid, :userid; // When I fork a process Oracle
says the cursor is invalid
}
EXEC SQL CLOSE C1; EXEC SQL COMMIT WORK RELEASE; Anyone gots an idea? Thanks in advance.
--
Fabrice Rochette
Student in electronics
and computer engineering
mailto:frochett_at_enssat.fr
http://altern.org/misterfx