Lob types in pl/sql, PL-SQL Programming

LOB Types

The large object (LOB) datatypes like BFILE, BLOB, CLOB, and NCLOB store the blocks of unstructured data (like graphic images, text, video clips, and sound waveforms) of up to four gigabytes in size. And, they allow random, efficient, piece-wise access to the data.

The LOB types are differing from the LONG and LONG RAW types in many ways. For example, the LOBs (except NCLOB) can be the attributes of an object type, but LONGs cannot. The maximum size of a LOB is 4 gigabytes, but the maximum size of a LONG is 2 gigabytes. The LOBs also support random access to data, but LONGs support only the sequential access.


You use the BFILE datatype to store the large binary objects in an operating system files outside the database. Every BFILE variable stores a file locator that points to a large binary file on the server. The locator involves a directory alias that specifies a full path name.

The BFILEs are read-only. You cannot modify or change them. The size of a BFILE is system dependent but cannot exceed 4 gigabytes (2**32 - 1 bytes). Your DBA makes sure that a given BFILE exists and that Oracle has read permissions on it. The underlying operating system maintains the file integrity.

The BFILEs do not participate in transactions, are not recoverable, and cannot be simulated. The highest number of open BFILEs is set by the Oracle initialization parameter SESSION_MAX_OPEN_FILES, that is system dependent.


You use the BLOB datatype to store the large binary objects in the database in-line or out-of-line. Each BLOB variable stores a locator, thatpoints to a large binary object. The size of a BLOB cannot exceed 4 gigabytes. The BLOBs participate fully in transactions, and are recoverable, and can replicate. The Changes made by package DBMS_LOB or the OCI can be committed or rolled back. Though, the BLOB locators cannot span transactions or sessions.


You use the CLOB datatype to store the large blocks of single-byte character data in the database, in-line or out-of-line. Both the fixed-width and variable-width character sets are supported. Each CLOB variable stores a locator that points to a large block of character data. The size of a CLOB cannot exceed 4 gigabytes. The CLOBs participate fully in transactions, and are recoverable, and can be replicated. The Changes made by package DBMS_LOB or the OCI can be committed or rolled back. Though, the CLOB locators cannot span transactions or sessions.

Other Types

The following types permit you to store and manipulate the logical values and date/time values.


You use the BOOLEAN datatype to store the logical values like TRUE, FALSE, & NULL. The BOOLEAN datatype takes no parameters. Only the values TRUE, FALSE, & NULL can be assigned to a BOOLEAN variable. You cannot insert the values like TRUE & FALSE into a database column. You cannot also select or fetch the column values into a BOOLEAN variable.


You use the DATE datatype to store the fixed-length date/time values. The DATE values involve the time of day in seconds since the midnight. The date portion defaults to the first day of the present month; the time portion defaults to midnight. The date function SYSDATE returns the present date and time.

For illustration, the following statement returns the number of days since an employee was hired:

SELECT SYSDATE - hiredate INTO days_worked FROM emp WHERE empno = 7499;

Posted Date: 10/2/2012 2:36:00 AM | Location : United States

Related Discussions:- Lob types in pl/sql, Assignment Help, Ask Question on Lob types in pl/sql, Get Answer, Expert's Help, Lob types in pl/sql Discussions

Write discussion on Lob types in pl/sql
Your posts are moderated
Related Questions
Declaring Exceptions The Exceptions can be declared only in the declarative part of the PL/SQL subprogram, block, or package. By introducing its name, you can declare an excep

Variable Declaration - SQL SQL's support for variables is very similar to Tutorial D's, except that the syntax for creating persistent  variables-base tables-is quite differen

Implicit Cursors The Oracle implicitly opens a cursor to process each SQL statement not related with an explicitly declared cursor. The PL/SQL lets you refer to the most recen

Overloading: Similar to packaged subprograms, methods of the same type can be overloaded. That is, you can use similar name for various methods if their formal parameters diff

ROWNUM The ROWNUM returns a number representing the order in which a row was selected from the table. The first row selected has a ROWNUM of 1; the second row has a ROWNUM of

Autonomous versus Nested Transactions Though an autonomous transaction is started by the other transaction, it is not a nested transaction for the reasons shown below: (i)

Transaction Control The Oracle is transaction oriented; that is, Oracle uses the transactions to make sure the data integrity. The transaction is a sequence of SQL data manip

LIKE Operator You use the LIKE operator to compare the character value to a pattern. The Case is significant. LIKE returns the Boolean value TRUE when the character patterns mat

Procedural Constraint Enforcement (Triggers) SQL has an alternative method of addressing database integrity, involving event-driven procedural code. The special procedures th

Data Types in SQL SQL's concept does not differ significantly from that defined in the theory book, apart from that business concerning NULL. However, the theory book equates