Oracle9i Application Developer's Guide - Large Objects (LOBs) Release 1 (9.0.1) Part Number A88879-01 |
|
LOB Support in Different Programmatic Environments, 4 of 11
The PL/SQL DBMS_LOB
package can be used for the following operations:
Oracle9i Supplied PL/SQL Packages Reference for detailed documentation, including parameters, parameter types, return values, and example code.
See Also:
As described in more detail below, DBMS_LOB
routines work based on LOB locators. For the successful completion of DBMS_LOB
routines, you must provide an input locator representing a LOB
that exists in the database tablespaces or external filesystem, before you invoke the routine.
LOB
columns, and subsequently you can use SQL to initialize or populate the locators in these LOB
columns.
DIRECTORY
object that maps to a valid physical directory containing the external LOB
s that you intend to access. These files must exist, and have READ permission for Oracle Server to process. If your operating system uses case-sensitive path names, specify the directory in the correct case. See Chapter 12, "External LOBs (BFILEs)", "Directory Object" for more information.
Once the LOB
s are defined and created, you may then SELECT
a LOB
locator into a local PL/SQL LOB
variable and use this variable as an input parameter to DBMS_LOB
for access to the LOB
value.
Examples provided with each DBMS_LOB
routine will illustrate this in the following sections.
Client-side PL/SQL procedures cannot call DBMS_LOB
package routines.
However, you can use server-side PL/SQL procedures or anonymous blocks in Pro*C/C++
to call DBMS_LOB
package routines.
For DBMS_LOB
package, i.e., for both fixed and varying-width character sets, the following rules apply:
When using DBMS_LOB.LOADFROMFILE
, you cannot specify the amount
parameter to be larger than the size of the BFILE.
When using DBMS_LOB.READ
, the amount parameter can be larger than the size of the data. In PL/SQL, the amount should be less than or equal to the size of the buffer, and the buffer size is limited to 32K.
PL/SQL functions and procedures that operate on BLOBs, CLOBs, NCLOBs, and BFILEs are summarized below:
PL/SQL: DBMS_LOB Procedures to Modify BLOB, CLOB, and NCLOB Values
Function/Procedure | Description |
---|---|
CREATETEMPORARY() |
Creates a temporary LOB |
ISTEMPORARY() |
Checks if a LOB locator refers to a temporary LOB |
FREETEMPORARY() |
Frees a temporary LOB |
Function/Procedure | Description |
---|---|
OPEN() |
Opens a LOB |
ISOPEN() |
Sees if a LOB is open |
CLOSE() |
Closes a LOB |
These procedures are described in detail for specific LOB
operations, such as, INSERT
a row containing a LOB,
in these chapters:
You can access many of the PL/SQL LOB example scripts from these chapters, at $ORACLE_HOME/rdbms/demo/lobs/plsql
.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|