|
|
|
<?PHP
// In diesem Beispiel wird beschrieben wie man eine StoredProcedure aufruft,
// einen Integer übergibt und diesen wieder ausgibt.
// Oracle Client muß installiert sein und die extension php_oci8 muß installiert sein!
// Bei dem Beispiel: ps
// Host-Name: rechner
// Port-Nummer: 1521
// Variablen
$usr = "Dein User";
$pwd = "Dein Passwort";
$sid = "Dienstname";
// Verbindung zum Oracle-Server herstellen
$conn = OCILogon ($usr, $pwd, $sid);
// SoredProcedure t_phpsaveproc(integer) aufrufen
$stmt = OCIParse($conn, "begin :result := t_phpsaveproc(1); end;");
// OCIBindByName bindet die Variable result an den Platzhalter $result
OCIBindByName($stmt, "result", &$result);
// Commit, hier werden die "Jobs" ausgeführt.
OCIExecute($stmt);
// Mit OCIResult wird der Rückgabewert der StoredProcedure aus der Menge in die PHP-Variable $result
geschrieben
OCIResult($stmt,$result);
// Ausgabe des Rückgabewertes
echo $result;
// Verbindung zum Oracle-Server schließen
ocilogoff($conn);
?> |
|
| Simple class for accessing databases like MSSql Server, Oracle etc by Raju Categories : PHP, MS SQL Server, Databases, PHP Classes, Oracle | | | get de errror message to access the database Categories : PHP, OCI8, Databases | | | normalize fields and strings used in where (command's Sql) Categories : PHP, Databases, Oracle, Functions | | | Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0. Categories : Databases, PHP, mSQL, Databases | | | PHP CLASS for ORACLE (database connectivity) Categories : PHP, PHP Classes, Classes and Objects, Databases, Oracle | | | This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | Connecting to Oracle with php3 Categories : Oracle, PHP, Databases | | | A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface. Categories : Databases, Oracle, PHP, Arrays, Variables | | | Paginator - a class that can help you to split MySQL database query result sets to pages. Categories : MySQL, Databases, HTML, PHP | | | db2tab.php - Simple scripts to access IBM DB2 Universal DataBase tables through PHP ODBC funtions. Categories : Databases, PHP, ODBC | | | A template script to provide the ability to get the next or previous n records from a MySQL database. Categories : Databases, PHP, MySQL | | | Simple class to create insert and update statements. Independent of the access to the database. Makes handling complex inserts easier - especially when the table structure is liable to change. Categories : Databases, PHP Classes, PHP | | | Returns the last row from a select where multiple rows have been selected.
In this case it is used to determine the last number in an AUTO_INCREMENT column. I use it to create "ticket numbers" or anything that needs a unique ID in sequence. Categories : mSQL, MySQL, Databases, PHP | | | MySQL Connection/Query Class Categories : Databases, MySQL, PHP, PHP Classes | | | phpYellow Pages Standard Categories : PHP, Complete Programs, Databases, Directories, Search | |
| | | | Laurence Veale wrote :666
Is this actually a stored procedure or a function?
I can call procedures no problem, but I`m not having any luck calling a function that returns a value to a PL/SQL variable.
How do I do the PHP equivalent of the following in PL/SQL...
DECLARE
answer NUMBER;
BEGIN
Answer:=package.function1(1500,`10-JUN-2001`,`23-JUL-2001`);
DBMS_OUTPUT.Put_Line(`The answer is: ` ||Answer);
END;
| |
|
|