Oracle9i Supplied PL/SQL Packages and Types Reference Release 1 (9.0.1) Part Number A89852-02 |
|
DBMS_LOB , 21 of 26
This procedure opens a LOB
, internal or external, in the indicated mode. Valid modes include read-only, and read-write. It is an error to open the same LOB
twice.
In Oracle8.0, the constant file_readonly
was the only valid mode in which to open a BFILE
. For Oracle 8i, two new constants have been added to the DBMS_LOB
package: lob_readonly
and lob_readwrite
.
DBMS_LOB.OPEN ( lob_loc IN OUT NOCOPY BLOB, open_mode IN BINARY_INTEGER); DBMS_LOB.OPEN ( lob_loc IN OUT NOCOPY CLOB CHARACTER SET ANY_CS, open_mode IN BINARY_INTEGER); DBMS_LOB.OPEN ( file_loc IN OUT NOCOPY BFILE, open_mode IN BINARY_INTEGER := file_readonly);
Parameter | Description |
---|---|
lob_loc |
|
open_mode |
Mode in which to open. |
OPEN
requires a round-trip to the server for both internal and external LOBs
. For internal LOBs
, OPEN
triggers other code that relies on the OPEN
call. For external LOBs
(BFILEs
), OPEN
requires a round-trip because the actual operating system file on the server side is being opened.
It is not mandatory that you wrap all LOB operations inside the Open/Close APIs. However, if you open a LOB, you must close it before you commit or rollback the transaction; an error is produced if you do not. When an internal LOB is closed, it updates the functional and domain indexes on the LOB column.
It is an error to commit the transaction before closing all opened LOBs that were opened by the transaction. When the error is returned, the openness of the open LOBs is discarded, but the transaction is successfully committed. Hence, all the changes made to the LOB and nonLOB data in the transaction are committed, but the domain and functional indexes are not updated. If this happens, you should rebuild the functional and domain indexes on the LOB column.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|