Re: AW: AW: [PHP-DB] Oracle Function Calls
| From: | Richard S. Crawford | Date: | Wed, 07 Mar 2001 22:01:17 +0000 |
| Subject: | Re: AW: AW: [PHP-DB] Oracle Function Calls | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-7176@lists.php.net to get a copy of this message | ||
Hm. Assuming that I don't have the option of rewriting the function to a procedure, is there another way to go?
At 10:54 PM 3/7/01 +0100, Matthias Kopolt wrote:
Oracle Divides Function in several Groups
DML means Data-Manipulating function;
(in your funciton is a update or insert)
to use a function in a query it needs to be "pure" only selects and
arithmetics
you can rewrite this function to a procedure and return your value as an out
parameter
$stmt = ociparse($dbh,"BEGIN p_foo_procedure('param_in',:1);END;" );
OCIBindByName ($stmt,":1",&$outparam,40);
ociexecute ($stmt);
OCIfreestatement($stmt);
40 is the buffer in chars/bytes (addjust if needed)
the procedure needs to declare the second argument as in and can declare the
second one as "out" or "in out"
mk
--
http://www.mossroot.com/index.php
AIM Handle: Buffalo2K
e-mail: rscrawford@mossroot.com
"When you lose the power to laugh at yourself, you lose the power to think straight." --Clarence Darrow