Introduces Oracle8 functions. These functions allow you to access Oracle8 and Oracle7 databases. it uses the Oracle8 vertex interface (OCI8 ). to use this extension module, you need the Oracle8 client library file. this extension module allows you to access Oracle8 and Oracle7 databases. it uses the Oracle8 vertex 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.
// 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)
// 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 );
Oracle8 and Oracle7 databases. it uses the Oracle 8 point interface (OCI8). to use this extension module, you need the Oracle8 client library file. this extension module...