Monday, February 28, 2011

how can pl/sql execute php ?

>Is there a way to execute PL/SQL scripts from PHP? I have PL/SQL scripts
>that utilizes the DBMS_xxx packages. Is it possible to shell out a command
>that will run the PL/SQL? You'll have to define what you mean by 'PL/SQL script'.

Do you mean a PL/SQL block? Just use OCIParse/OCIExecute. There's an example
in the PHP manual.

Or do you mean you have a file containing one or more SQL and/or anonymous
PL/SQL blocks, which you'd normally run with SQL*Plus? And in particular, does
it use any SQL*Plus commands? (e.g. SET, or COLUMN). If so, shell out to
SQL*Plus with system() or exec() or backticks etc.

No comments:

Post a Comment