These functions allow you to access the Oracle8 and Oracle7 databases. They use the Oracle8 point-of-use interface (OCI8). To use this extension module, you need the Oracle8 client library file.
This expansion module is smoother than the standard Oracle module. It supports global and local PHP variables used for Oracle site symbols. Complete LOB, file, and ROWID support are available, allowing you to use User-Defined variables.
Before using this extension, make sure that you have correctly installed the oracle environment variables required by Oracle users, which are the same as those for daemon users. The variables to be set are roughly as follows:
ORACLE_HOME
ORACLE_SID
LD_PRELOAD
LD_LIBRARY_PATH
NLS_LANG
ORA_NLS33
After setting the environment variable of your web server user, confirm that the web Server user (nobody, www) is added to your oracle group ).
Example 1.
<? Php
// Author sergo@bacup.ru
// Use parameter configuration: OCI_DEFAULT to execute the command to delay execution
OCIExecute ($ stmt, OCI_DEFAULT );
// Obtain the data:
$ Result = OCIResult ($ stmt, $ n );
If (is_object ($ result) $ result = $ result-> load ();
// Insert or update:
$ SQL = "insert into table (field1, field2) values (field1 = 'value ',
Field2 = empty_clob () returning field2 into: field2 ";
OCIParse ($ conn, $ SQL );
$ Clob = OCINewDescriptor ($ conn, OCI_D_LOB );
OCIBindByName ($ stmt, ": field2", & $ clob,-1, OCI_ B _CLOB );
OCIExecute ($ stmt, OCI_DEFAULT );
$ Clob-> save ("some text ");
?>
You can use the same simple method to store program command lines.
Example 2: stored process (Program)
<? Php
// Author webmaster@remoterealty.com
$ Something = OCIParse ($ dbh, "begin sp_newaddress (: address_id, '$ firstname ',
'$ Lastname',' $ company ',' $ address1 ',' $ address2 ',' $ city ',' $ State ',
'$ Postalcode',' $ country ',: error_code); end ;");
// This call is used to store the sp_newaddress process. Use: address_id to start
// In/out variables and: error_code are used to output variables.
// Implement bundling as follows:
OCIBindByName ($ something, ": address_id", $ addr_id, 10 );
OCIBindByName ($ something, ": error_code", $ errorcode, 10 );