Re: OCI8 Stored procedure execution
| From: | thies at digicol dot de | Date: | Mon, 12 Jun 2000 13:14:37 +0000 |
| Subject: | Re: OCI8 Stored procedure execution | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-339@lists.php.net to get a copy of this message | ||
On Mon, Jun 12, 2000 at 08:28:52AM -0400, Fred Bulah wrote:
>
> Hello all,
>
> I am a new OCI8 user and am trying to execute an Oracle 8i stored
> procedure and get a return value back.
>
> The PHP4 code is:
>
> <?php
> print "<HTML><PRE>";
> print "test 8: execute stored procedure<br>";
> $conn = OCILogon("fredb","fmb22956");
> $stmt = OCIParse( $conn, "execute mytest( :albumItemId );" );
> OCIBindByName( $stmt, ':albumItemId', &$albumItemId, 10 );
> OCIExecute( $stmt );
> print "albumItemId=$albumItemId<br>";
> OCIFreeStatement($stmt);
> OCILogOff($conn);
> print "</PRE></HTML>";
> ?>
>
> Produces the following error:
>
> test 8: execute stored procedure
>
> Warning: OCIStmtExecute: ORA-00900: invalid SQL statement
> in /home/fredb/xanboo/htdocs/testoci8.htm on line 14
execute is not a known sql-command. (it's only known by
sqlplus)
try
"begin mytest( :albumItemId ); end;"
instead.
tc
>
> albumItemId=
>
>
> The stored procedure definition is:
>
> /* mytest.sp: test stoed procedure */
> create or replace procedure mytest( albumItemId out number )
> is
> begin
> select albumitemseq.nextval into albumItemId from dual;
> end;
> /
>
> Executes without a problem from SQL/Plus.
>
> Can anyone help me locate the problem?
> Thanks.
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany