ok, i found the answer for using cursors in the description for
ocinewcursor. so it should be:

$query = "BEGIN :result := ACCESSLIST.GETRIGHTS(:in_val); END;";
$curs = ocinewcursor($conn);
$stmt = ociparse ($conn, $query);
ocibindbyname($stmt, ":result", &$curs, -1, OCI_B_CURSOR);
ocibindbyname($stmt, ":in_val", &$value, -1);

while(ocifetchinto($curs), &$row, OCI_ASSOC+OCI_RETURN_NULLS)) {
    // do somthing with $row array

But i now can't test if i can access the function this way. am not at work.
Anyone knows if i can access the oracle function through php or do i need
a procedur with an out parameter as wrapper for php?

Regards Michael

"Michael Virnstein" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> Hi,
> i have the following problem: (database Oracle 8.1.7)
> we got a package ACCESSLIST with a function GETRIGHTS.
> this function returns a cursor. So what i want now is calling this
> and walk through the returned cursor:
> this is what i have so far, but it brings me some errors:
> $query = "BEGIN :result := ACCESSLIST.GETRIGHTS(:in_val); END;";
> $stmt = ociparse ($conn, $query);
> ocibindbyname($stmt, ":result", &$res, -1);
> ocibindbyname($stmt, ":in_val", &$value, -1);
> ociexecute($stmt);
> ok...the first error i get is :
> "GETRIGHTS is not a procedure or isn't defined."
> GETRIGHTS is defined on the DB in package ACCESSLIST,
> but it's a function, not a procedure.
> Is it not possible to call a oracle function from within php?
> what is theerror here. how to call the function? how to bind the :result
> cursor and
> how to walk through it? using ocifetchinto or something?
> please help! any sample code and some additional knowledge on calling
> oracle functions from within php are highly appreciated.
> Regards Michael

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

Reply via email to