Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Using Large Objects (LOBs)

The LOB datatypes (OraBLOB/OraCLOB and OraBFILE) enable you to store large blocks of unstructured data, such as text, graphic images, video clips, and sound waveforms, up to four gigabytes in size. They provide efficient, random, piece-wise access to the data.

· Retrieving LOBs from the Database

· Performance Considerations with LOB Read and Write

· Writing LOB Data

· Reading LOB Data

· Migration from Long Raw to LOB/BFILE

The LOBs datatype is further sub divided into the following four types:

LOB Datatypes

LOB Types
a LOB whose value is composed of

BLOB
unstructured binary ("raw") data.

CLOB
single-byte fixed-width character data that corresponds to the database character set defined for the Oracle database.

NCLOB
fixed-width multibyte character data that corresponds to the national character set defined for the Oracle database.

BFILE
a LOB whose large binary data is stored in operating system files outside of database tablespaces. They may also be located on tertiary storage devices such as hard disks, CD-ROMs, PhotoCDs, and DVDs.


In Oracle Objects for OLE, an instance of the BLOB datatype is represented as an OraBlob interface, a CLOB/NCLOB datatype is represented as an OraClob interface, and a BFILE datatype is represented as an OraBFile interface.

The following example creates a table having BLOB and CLOB columns and inserts some rows into it using ExecuteSQL method on OraDatabase object.

Set OO4OSession = CreateObject("OracleInProcServer.XOraSession")

Set InvDb = OO4OSession.OpenDatabase("INVDB", "scott/tiger", 0)

InvDb.ExecuteSQL("create table part(part_id NUMBER, part_name

VARCHAR2(20),part_image BLOB, part_desc CLOB)")

InvDb.ExecuteSQL ("insert into part values (1,'ORACLE

NETWORK',EMPTY_BLOB(),EMPTY_CLOB())")

InvDb.ExecuteSQL ("insert into part values (2,'ORACLE SERVER',

EMPTY_BLOB(),EMPTY_CLOB())")

The EMPTY_BLOB() and EMPTY_CLOB() PL/SQL functions provide an empty LOB to insert into the LOB column.