DBMS_LOB package

The DBMS_LOB package provides the capability to operate on large objects.

In the following sections describing the individual procedures and functions, lengths and offsets are measured in bytes if the large objects are BLOBs. Lengths and offsets are measured in characters if the large objects are CLOBs.

The DBMS_LOB package supports LOB data up to 10M bytes.

The DBMS_LOB package includes the following routines.

Table 1. System-defined routines available in the DBMS_LOB package
Routine Name Description
APPEND procedure Appends one large object to another.
COMPARE function Compares two large objects.
COPY procedure Copies one large object to another.
ERASE procedure Erases a large object.
GETLENGTH function Gets the length of the large object.
INSTR function Gets the position of the nth occurrence of a pattern in the large object starting at offset.
READ procedure Reads a large object.
SUBSTR function Gets part of a large object.
TRIM procedure Trims a large object to the specified length.
WRITE procedure Writes data to a large object.
In partitioned database environments, you will receive an error if you execute any of the following routines inside a WHERE clause of a SELECT statement:
  • dbms_lob.compare
  • dbms_lob.get_storage_limit
  • dbms_lob.get_length
  • dbms_lob.instr
  • dbms_lob.isopen
  • dbms_lob.substr
The following table lists the public variables available in the package.
Table 2. DBMS_LOB public variables
Public variables Data type Value
lob_readonly INTEGER 0
lob_readwrite INTEGER 1