Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
4.96 Mб

Representing Searchable Text Data

Representing Searchable Text Data

Rather than writing low-level code to do full-text searches, you can use Oracle9i Text, formerly known as ConText and interMedia Text. It stores the search data in a special kind of index, and lets you query the data with operators and PL/SQL packages. This makes it simple to create your own search engine using data from tables, files, or URLs, and combine the search logic with relational queries. You can also search XML data this way, using XPath notation.

For more information, see Oracle Text Application Developer's Guide.

Representing Large Amounts of Data

The database provides several datatypes for representing large amounts of data. These datatypes are grouped under the general category of Large Objects (LOBs); they are described in Table 2–6:

Table 2–6 Large Object Datatypes

Datatype Description


Binary Large Object


Suitable for representing large amounts of binary data such as


images, video, or other multimedia data.


Character Large Object


Suitable for representing large amounts of character data. CLOB


types are stored using the database character set.


National Character Set Large Object


Suitable for representing large amounts of character data in


National Character Set format.


Datatype for storing Large Objects in the operating system's file


system, outside of the database files or tablespace. Note that the


BFILE type is read-only; other LOB types are read/write. BFILE


objects are also sometimes referred to as external LOBs.



An instance of type BLOB, CLOB, or NCLOB can exist as either a persistent LOB instance or a temporary LOB instance. Persistent and temporary instances differ as follows:

A temporary LOB instance is declared in the scope of your application.

A persistent LOB instance is created and stored in the database.

2-34 Oracle Database Application Developer's Guide - Fundamentals

Representing Large Amounts of Data

With the exception of declaring, freeing, creating, and committing, operations on persistent and temporary LOB instances are performed the same way.

For more details on using LOBs in applications, see the Oracle Database Application Developer's Guide - Large Objects.

Note: In earlier releases, the LONG, RAW, and LONG RAW datatypes were typically used to store large amounts of data. Use of these types is no longer recommended for new development. If your application still uses these types, migrate your application to use LOB types. See the Oracle Database Application Developer's Guide - Large Objects

Using RAW and LONG RAW Datatypes

Note: Oracle recommends that you convert LONG RAW columns to binary LOB (BLOB) columns and convert LONG columns to character LOB (CLOB or NCLOB) columns. LOB columns are subject to far fewer restrictions than LONG and LONG RAW columns.

See Also:

See Oracle Database Application Developer's Guide - Large Objects for information about the BLOB and BFILE datatypes

See the Oracle Database SQL Reference for restrictions on LONG and LONG RAW datatypes

The RAW and LONG RAW datatypes store data that is not interpreted by Oracle Database (that is, not converted when moving data between different systems). These datatypes are intended for binary data and byte strings. For example, LONG RAW can store graphics, sound, documents, and arrays of binary data; the interpretation is dependent on the use.

Oracle Net and the Export and Import utilities do not perform character conversion when transmitting RAW or LONG RAW data. When Oracle Database automatically converts RAW or LONG RAW data to and from CHAR data (as is the case when entering RAW data as a literal in an INSERT statement), the data is represented as one hexadecimal character representing the bit pattern for every four bits of RAW data.

Selecting a Datatype 2-35

Соседние файлы в папке Oracle 10g