Use PHP to access ORACLELOB in the bsstructure

Source: Internet
Author: User
Abstract: This article describes how to use PHP database access technology to store ORACLELOB data objects. Keywords: PHP; ORACLE; LOB; storage; introduction PHP, that is, "PHP: Hyper...

Abstract: This article describes how to use PHP database access technology to store oracle lob data objects.
Keywords: PHP; ORACLE; LOB; storage;
Introduction
PHP, known as "PHP: Hypertext Preprocessor", is a multi-purpose scripting language widely used in Open Source (Open Source) and can be embedded in HTML. Its syntax is similar to C, Java, and Perl and is easy to learn. The main goal of this language is to allow Web developers to quickly write dynamically generated Web pages. However, PHP functions are not limited to this. PHP is generally considered to be able to implement complex programming tasks faster and more effectively, it is precisely because it is more stable and consumes less resources that it has become a necessary WEB script design language for the development of B/S structure systems, playing a role similar to middleware, that is, syntax parsing and execution.
Oracle lob data model
In B/S (Browser/Server, Browser/Server) application systems, more than just simple text information needs to be stored, it also includes images, audio and video materials, or ultra-long texts. For example, if a document system is developed, common characters or other types of data descriptions cannot be used in binary files or ultra-long texts such as charts and attachments in documents, this requires the backend database to have the ability to store the data. Oracle LOB objects can be used to implement this function.
Oracle LOB is a data type used to store a large amount of binary and text data (a LOB field can store up to 4 GB of data ). Currently, it can be divided into two types: internal LOB and external LOB. Internal LOB stores data in the database as byte streams. Therefore, many internal LOB operations can be involved in transactions, or they can be backed up and restored just like normal data. Oracle8i supports three types of internal LOB: BLOB (binary data), CLOB (single-byte character data), and NCLOB (multi-byte country character data ). The CLOB and NCLOB types are suitable for storing ultra-long text data, and the BLOB field is suitable for storing a large amount of binary data, such as, video, and audio. Currently, Oracle8i only supports one type of external LOB, that is, BFILE. In the database, this type only stores the location information of data in the operating system, and the file form other than the data entity exists in the operating system file system. Therefore, the data of this type is read-only and does not participate in transactions. This type helps users manage a large number of files accessed by external programs.
PHP Oracle 8 function analysis
There are two ORACLE function extension libraries in PHP. the ORACLE8 functions allow access to the Oracle8 and Oracle7 databases. these functions use Oracle8 Call-Interface (OCI8 ), you can bind local and global PHP variables to the Oracle location flag. full support for LOB, FILE, and ROWID allows you to use user-defined variables, that is, user-defined object classes of your database.
The OCIFetchInto function in the Oracle8 function library is used to retrieve a row of data records and put them into an array. the syntax of this function is described as follows:

Address:

Reprinted at will, but please attach the article address :-)

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.