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

Home -> Community -> Usenet -> c.d.o.misc -> fork a process while(sqlca.sqlcode==0)

fork a process while(sqlca.sqlcode==0)

From: Fabrice ROCHETTE <frochett_at_enssat.fr>
Date: Thu, 24 Feb 2000 17:57:13 -0500
Message-ID: <38B5B748.5DBF1AD0@enssat.fr>


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


Received on Thu Feb 24 2000 - 16:57:13 CST

Original text of this message

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