Oracle 7 stored procedure execution
| From: | Paolo Brutti | Date: | Tue, 20 Jun 2000 10:14:41 +0000 |
| Subject: | Oracle 7 stored procedure execution | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-512@lists.php.net to get a copy of this message | ||
Hi all,
I've tried to adapt for Oracle 7 the same trick Thies suggested for
returning refcursors from a stored procedure, with no success: I've been able
to add the proc to the database, but I haven't been able to get it working from
PHP.
My question is: is it a PHP limitation (i.e. is it possible to extend the
PHP/Oracle interface to make it work), an Oracle 7 limitation (i.e. is there a
workaround?) or am I simply too dumb to understand it (i.e., please explain me
what am I doing wrong ;-))
Here is the php code (the SQL part is the same as Thies suggested)
<?php
$conn=ora_logon("username","pwd");
$query=ora_open($conn);
ora_parse($query, "BEGIN info.output(:handle);END;");
$my_handle=ora_open($conn);
ora_bind($query, "my_handle", ":handle", 32);
ora_exec($query);
ora_fetch($my_handle);
for ($i=0; $i <3; $i++) {
echo ora_getcolumn($my_handle, $i);
}
exit;
?>
And this is what I get back
Warning: Ora_Exec failed (ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments
in call to 'OUTPUT' ORA-06550: line 1, column 7: PL/SQL:
Statement ignored -- while processing OCI function OEXEC/OEXN) in
/usr/local/apache/htdocs/paolo/mio.php on line 7
Thanks
--
Paolo Brutti | Abbiamo un accordo con Dio:
Telesoft S.p.a. | Lui non scrive programmi,
Tel. +39-06-71035675 | noi non facciamo miracoli.