Re: Calling Oracle Functions

From: Date: Tue, 30 Apr 2002 17:30:45 +0000
Subject: Re: Calling Oracle Functions
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18911@lists.php.net to get a copy of this message
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); ociexecute($stmt); ociexecute($curs); 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" <michael.virnstein@web.de> schrieb im Newsbeitrag news:20020430160717.77325.qmail@pb1.pair.com... > 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 function > 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 > >

« previous php.db (#18911) next »