Run stored Procedure in oracle database in PHP

Asked

Viewed 503 times

0

I have the procedure "exemplo1" which receives 3 input parameters and no output parameters, as I do to execute it in PHP.

In case it would be so.

EXEC "exemplo1"('para1','para1','para3');

How does the code in PHP tested so and did not work

$sql = 'EXECUTE "PORTAL_importaXml"'. "(?,?,?)";
$stmt = Conecta::prepareOrc($sql);
$stmt->bindParam(1, $p1);
$stmt->bindParam(2, $p2);
$stmt->bindParam(3, $p3);
return $stmt->execute();`

Thanks in advance.

  • What connection library are you using? OCI8 or PDO? Apparently it’s PDO.

  • I’m using PDO, any problem regarding the use of it? If it only works on OCI8 have some example for connection.

  • Example 5 is what you need. This is the official documentation http://php.net/manual/pdo.prepared-statements.php

1 answer

-1

No need to quote on the name of the project:

$sql = 'EXECUTE PORTAL_importaXml (?,?,?)';

Browser other questions tagged

You are not signed in. Login or sign up in order to post.