Oracle8i Application Developer's Guide - Large Objects (LOBs) Release 2 (8.1.6) Part Number A76940-01 |
|
LOB Programmatic Environments, 4 of 9
The PL/SQL DBMS_LOB package can be used for the following operations:
Oracle8i 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 11, "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 |
---|---|
|
Creates a temporary LOB |
|
Checks if a LOB locator refers to a temporary LOB |
|
Frees a temporary LOB |
Function/Procedure | Description |
---|---|
|
Closes the file1 |
|
Closes all previously opened files |
|
Checks if the file exists on the server |
|
Gets the directory alias and file name |
|
Checks if the file was opened using the input BFILE locators2 |
|
Opens a file3 |
1
Use CLOSE() instead. 2 Use ISOPEN() instead. 3 Use OPEN() instead. |
Function/Procedure | Description |
---|---|
|
Opens a LOB |
|
Sees if a LOB is open |
|
Closes a LOB |
We will describe these procedures in greater detail as we explore specific LOB
operations (e.g., INSERT
a row containing a LOB
) in the following chapters:
You will be able to access associated PL/SQL example scripts from your Oracle8i software CD /rdbms/demo directory in a future release.
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|