These functions allow you to access the Oracle8 and Oracle7 databases. He uses the Oracle8 point interface (OCI8). With this extension, you need to Oracle8 the client library files.
This expansion module is more fluid than the standard Oracle module. He supports global and native PHP variables for Oracle stand characters. There are full LOB, file, and ROWID supported variables that allow user-supplied definitions to be used.
Before using this extension, verify that you have correctly installed the Oracle environment variables required by Oracle users, as well as for daemon users. The variables you need to set are roughly the following:
Oracle_home
Oracle_sid
Ld_preload
Ld_library_path
Nls_lang
Ora_nls33
After setting the environment variables for your Web server users, confirm that you have added Web server users (nobody, WWW) to your Oracle group.
Example 1.
Author sergo@bacup.ru
Use parameter configuration: Oci_default execute command to delay execution
Ociexecute ($stmt, Oci_default);
Get the data:
$result = Ociresult ($stmt, $n);
if (Is_object ($result)) $result = $result->load ();
To insert or update an operation:
$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 store the program command line in the same simple way.
Example 2. For storing processes (Programs)
Author webmaster@remoterealty.com
$sth = Ociparse ($DBH, "Begin sp_newaddress (: address_id, ' $firstname ',
' $lastname ', ' $company ', ' $address 1 ', ' $address 2 ', ' $city ', ' $state ',
' $postalcode ', ' $country ',: error_code); end; ");
This call is used to store the process sp_newaddress, using: address_id to start a
In/out variables and: Error_code are used for output variables.
This implements the bundle:
Ocibindbyname ($sth, ": address_id", $addr _id, 10);
Ocibindbyname ($sth, ": Error_code", $errorcode, 10);
http://www.bkjia.com/PHPjc/631045.html www.bkjia.com true http://www.bkjia.com/PHPjc/631045.html techarticle These functions allow you to access the Oracle8 and Oracle7 databases. He uses the Oracle8 point interface (OCI8). With this extension, you need to Oracle8 the client library files. This extension module ...