Oracle8i Application Developer's Guide - Large Objects (LOBs) Release 2 (8.1.6) Part Number A76940-01 |
|
Advanced Topics, 4 of 6
When you create an object in the object cache that contains an internal LOB
attribute, the LOB
attribute is implicitly set to empty. You may not use this empty LOB
locator to write data to the LOB
. You must first flush the object, thereby inserting a row into the table and creating an empty LOB
-- that is, a LOB
with 0 length. Once the object is refreshed in the object cache (use OCI_PIN_LATEST
), the real LOB
locator is read into the attribute, and you can then call the OCI LOB
API to write data to the LOB
.
When creating an object with an excternal LOB (BFILE)
attribute, the BFILE
is set to NULL
. It must be updated with a valid directory alias and filename before reading from the file.
When you copy one object to another in the object cache with a LOB
locator attribute, only the LOB
locator is copied. This means that the LOB
attribute in these two different objects contain exactly the same locator which refers to one and the same LOB
value. Only when the target object is flushed is a separate, physical copy of the LOB
value made, which is distinct from the source LOB
value.
See Also:
"Example of an Update Using Read Consistent Locators" for a description of what version of the |
Therefore, in cases where you want to modify the LOB
that was the target of the copy, you must flush the target object, refresh the target object, and then write to the LOB
through the locator attribute.
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|