PHP - Calling a Oracle 9i procedure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am trying to call a procedure in Oracle 9i but I just can't get it to
work...

My procedure has 5 IN values and return 1 REF CURSOR called :p_cursor

When I run my script I just keep getting this error:

Warning: OCIFetchInto: ORA-08103: object no longer exists in
E:\Intranet\test.php on line 35   	
which is the while (OCIFetchInto($curs, $p_cursor, OCI_ASSOC)) {
line....

Please help me with this...I am so stuck...



My PHP code looks like this:

$db = " (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
255.255.0.0)(PORT = 1521)) (CONNECT_DATA = (SID = xxxx)) )";

$conn = OCILogon("logon", "passoword", $db) or die('No Connection');

$curs = OCINewCursor($conn);
$query = "begin NB_P_TRAILBALANCE(:fromDate, :toDate, :companyCode,
:budgetCode, :startYear, :p_cursor); end;";
$stmt = OCIParse($conn, $query) or die ('Can not parse query');


ocibindbyname($stmt, ":fromDate", &$fromDate, -1);
ocibindbyname($stmt, ":toDate", &$toDate, -1);
ocibindbyname($stmt, ":companyCode", &$companyCode, -1);
ocibindbyname($stmt, ":budgetCode", &$budgetCode, -1);
ocibindbyname($stmt, ":startYear", &$startYear, -1);;
ocibindbyname($stmt, ":p_cursor", &$curs, -1, OCI_B_CURSOR);

$fromDate = '01/04/04';
$toDate = '30/04/04';
$companyCode = '01';
$budgetCode = '10909';
$startYear = '01/07/03';

ociexecute($stmt);
ociexecute($curs);

while (OCIFetchInto($curs, $p_cursor, OCI_ASSOC)) {

   var_dump($duties);

}

OCIFreeStatement($stmt);
OCIFreeCursor($curs);
OCILogoff($conn);

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux