Creating PL/SQL Procedures in PHP : Oracle : Databases PHP Source Code


PHP Source Code » Databases » Oracle »

 

Creating PL/SQL Procedures in PHP


Procedures, functions and triggers can be created using PHP. For example, to create the procedure myproc the code is:
<?php

$c 
oci_connect('hr''hrpwd''//localhost/XE');
$plsql "create or replace procedure "
            
"myproc(d_p in varchar2, i_p in number) as "
            
"begin "
            
"insert into mytab (mydata, myid) values (d_p, i_p);"
            
"end;";
$s oci_parse($c$plsql);
$r oci_execute($s);
if (
$r) {
echo 
'Procedure created';
}
?>
Note that there is a semi-colon after the PL/SQL keyword end, which is different to the way
SQL statements are written.


HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Databases
» Oracle