The process is killed after OCIFetch()

Links for php scripts

Moderators: macek, egami, gesf

Post Reply
strmdn

The process is killed after OCIFetch()

Post by strmdn » Tue Jan 21, 2003 8:13 am

Hello,

we have a PHP script that run in a infinite loop looking
on ORACLE DB (8.1.7). In each loop a SELECT is done, if this doesn't
return data then the SELECT is executed after two seconds. If after not
certain time the SELECT doesn't return data then when it returns data
the process is killed after OCIFetch(), view code for understand
better.

//START

//Set max execution time to infinite

set_time_limit(0);

$dbConnection = @OCILogon(USER_ID, PASSWORD, SID);
// infinite loop
$error=0;
do
{
$query="SELECT DATA FROM PROV";
$stmt = @OCIParse($dbConnection,$query);
@OCIDefineByName($stmt,"DATA",&$data);
@OCIExecute($stmt);
$err_ora = @OCIError($stmt);
if ($err_ora)
{
$error=1;

}

While (@OCIFetch($stmt) && ($error==0))
{
....
....

}
@OCIFreeStatement($stmt);
sleep(2);

}while ($error==0);

Thanks for any suggestion

strmdn

The process is killed after OCIFetch()

Post by strmdn » Wed Jan 22, 2003 3:47 am

The error has been found, the function OCIFetch() is not responsible
but the function echo in the cycle while it causes an error from the
moment that after the run of the
script the shell is closed.

Thank you and sorry for all.

:lol:

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Post by Joan Garnet » Wed Jan 22, 2003 5:03 am

Have you tried with a persistent connection?
OCIPLogon --> Connect to an Oracle database using a persistent connection

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest