Oracle9i Supplied PL/SQL Packages and Types Reference Release 1 (9.0.1) Part Number A89852-02 |
|
DBMS_LOB , 20 of 26
This procedure copies all, or a part of, a source external LOB
(BFILE
) to a destination internal LOB
.
You can specify the offsets for both the source and destination LOBs
, and the number of bytes to copy from the source BFILE
. The amount
and src_offset
, because they refer to the BFILE
, are in terms of bytes, and the dest_offset
is either in bytes or characters for BLOBs
and CLOBs
respectively.
If the offset you specify in the destination LOB
is beyond the end of the data currently in this LOB
, then zero-byte fillers or spaces are inserted in the destination BLOB
or CLOB
respectively. If the offset is less than the current length of the destination LOB
, then existing data is overwritten.
There is an error if the input amount plus offset exceeds the length of the data in the BFILE
.
DBMS_LOB.LOADFROMFILE ( dest_lob IN OUT NOCOPY BLOB, src_file IN BFILE, amount IN INTEGER, dest_offset IN INTEGER := 1, src_offset IN INTEGER := 1); DBMS_LOB.LOADFROMFILE( dest_lob IN OUT NOCOPY CLOB CHARACTER SET ANY_CS, src_file IN BFILE, amount IN INTEGER, dest_offset IN INTEGER := 1, src_offset IN INTEGER := 1);
It is not mandatory that you wrap the LOB operation inside the Open/Close APIs. If you did not open the LOB before performing the operation, the functional and domain indexes on the LOB column are updated during the call. However, if you opened the LOB before performing the operation, you must close it before you commit or rollback the transaction. When an internal LOB is closed, it updates the functional and domain indexes on the LOB column.
If you do not wrap the LOB operation inside the Open/Close API, the functional and domain indexes are updated each time you write to the LOB. This can adversely affect performance. Therefore, it is recommended that you enclose write operations to the LOB within the OPEN
or CLOSE
statement.
Exception | Description |
---|---|
VALUE_ERROR |
Any of the input parameters are |
INVALID_ARGVAL |
-
-
- |
CREATE OR REPLACE PROCEDURE Example_l2f IS lobd BLOB; fils BFILE := BFILENAME('SOME_DIR_OBJ','some_file'); amt INTEGER := 4000; BEGIN SELECT b_lob INTO lobd FROM lob_table WHERE key_value = 42 FOR UPDATE; dbms_lob.fileopen(fils, dbms_lob.file_readonly); dbms_lob.loadfromfile(lobd, fils, amt); COMMIT; dbms_lob.fileclose(fils); END;
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|