AW: [PHP-DB] Oracle, Stored Procedure Out Variable confusion
| From: | Matthias Kopolt | Date: | Wed, 14 Feb 2001 20:13:22 +0000 |
| Subject: | AW: [PHP-DB] Oracle, Stored Procedure Out Variable confusion | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-6639@lists.php.net to get a copy of this message | ||
> please create the shortest possible testcase that
> demonstrates your problem and send it to the list.
you need a PL/SQL stored procedure
like
CREATE PROCEDURE "SCHEMANAME"."P_TEST" (p_error out number) IS
BEGIN
p_error := 0;
END p_test;
than run a php script connecting to db and quering
$stmt = ociparse($dbh,"BEGIN P_TEST(:1);END;" );
OCIBindByName ($stmt,":1",&$error, 4);
ociexecute ($stmt);
if ($error == 0) { echo "equal"; }
else { echo "not equal"; }
after pressing about 20 times the reload button you will notice that both
branches of the if are reached
"$error" == "0" will deliver the right decision.
(I already tried to initialize $error before binding, but it had no
influence...)
mk