Home| Progetto| Web| Faq| Acronimi | ||||
Argomenti Documenti pubblicabili:1120
Scripts:1282 Documenti non pubblicabili:162 Categorie tematiche:68 .Net |_C# |_Visual basic.net |_Asp.net Active Server Pages C++ Cascade Style Sheet JavaScript Mysql Php Xml Java |_Java 2 Micro Edition |_Java server pages |_Java Servlet Oracle |_PLSQL PostgreSQL Unix
Php...
Info:
Php's story
Oracle...
Script:
Redo log
Unix...
Tip:
Rimuovere un file in Unix / Delete a file
PLSQL...
Script:
How to store in a variable execute immediate results
Php...
Tip:
Ignorare gli errori
Php...
Faq:
What is PHP?
Shell scripting...
Script:
Script for archiving and compressing folder and file
A User Agent, like a web browser, uses HTTP to request a HTML document
Php Funzione mail()
In programming the danger of exploring the small details of coding is that you get obsessed with every line of code you write, thereby greatly reducing productivity.
In general, is not worth obsessing over code. On the other hand you should code with deliberation and intent. Steven Feurstein Oracle Magazine July /August 2004 A User Agent, like a web browser, uses HTTP to request a HTML document
|
Php
Home >Php > Php and Oracle executing pl/sql procedure with input and output values
In this example the php page execute a sample pl/sql function, to simplify the pl/sql code does not interact as usually with datas. Infact pl/sql procedure pro_demo_in_out receives an input number and returs the number doubled and the type (even or odd):
create or replace procedure pro_demo_in_out(in_num in number, out_double out number, out_type out varchar2)
IS BEGIN out_double := in_num * 2; if MOD(in_num,2) = 0 then -- even out_type:= 'EVEN'; else -- odd out_type:= 'ODD'; end if; end; Here the php code to execute the pl/sql program: # defining connection to Oracle DB $schema = 'TEST'; $passw = 'TEST'; $condes = 'DB2M'; $job_id = 'demo_in_out'; $vin_num = 100; if ($c=OCILogon($schema ,$passw, $condes)) { echo "Successfully connected to Oracle. "; #OCILogoff($c); } else { $err = OCIError(); echo "Oracle Connect Error " . $err[text]; } $stmt ="begin pro_demo_in_out(:vin_num, :vout_double,:vout_type); end;"; // Calling plsql procedure... $s = OCIParse($c, $stmt); OCIBindByName($s, ":vin_num", $vin_num); OCIBindByName($s, ":vout_double", $vout_double,10);// 10 is the return length OCIBindByName($s, ":vout_type", $vout_type,5);// 5 is the return length OCIExecute($s, OCI_DEFAULT); echo "Procedure returned value: " . $vout_double; echo " "; echo "Procedure returned value: " . $vout_type; OCILogoff($c); $in_var = 10; ?> Web page output:
Successfully connected to Oracle.
Marco Magnani
Procedure returned value: 200 Procedure returned value: EVEN Warning: include(ads/text468x15.html): failed to open stream: No such file or directory in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Warning: include(): Failed opening 'ads/text468x15.html' for inclusion (include_path='.;C:\php\pear') in D:\inetpub\webs\fishscriptcom\documents\view_document.php on line 131 Tutorial ![]() ![]() ![]() ![]() ![]() Script ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Comandi ![]() ![]() ![]() ![]() ![]() |
Cerca
Php...
Info:
The Class Structure
Anger is creative, depression is useless.
Dyson, Freeman J. Anger is creative, depression is useless.
Dyson, Freeman J.
Php...
Info:
Creare immagini con il codice
Php...
Definizioni:
PHP
Oracle...
Definizioni:
Transazione
Shell scripting...
Script:
Debug shell program
fishScript.Com is accessible by Mobile access technology
as mobile phones, Palm and Pocket PC .
Nicoleta e Marco Magnani tutorial, examples, courses, esempi, corsi, esercizi, appunti vari Dottoressa Nicoleta Dragu Formatrice Docente Insegnante Mediatrice Culturale Dott. Marco Magnani Universita La Sapienza Roma Master Computer Science Hunter College New York , Data Base Administrator DBA oracle System architect |