Introduction to the functions of Oracle 8 _php Tutorial

Source: Internet
Author: User
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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.