Lob question
TiminAug 11 2011 — edited Aug 12 2011Hi all.
I have a cuple of questions with regard to lob objects.
1. Documentation says that a lob locator always exists for an intialized object. Does it mean that it exists even for an in-row object?
The second question is rather tricky. I know we can load a clob value into a varchar variable directly using select clob_column_name into my_var syntax (of course if the value is less than 32 kb) inside pl/sql block. Thus we can start working with the value itself rather than locator. But if i load a varchar value into a clob variable... it also works... What is really stored in the clob variable then? First I suggested - locator, but it seems to be wrong cause this clob variable can be modified using the value style approach rather then locator-style (which implies using dbms_lob procedures).
If this clob variable holds a locator as it should do then where is the lob value itself? In the memory also, in the default temporary tablespace or where? I use this approach because i know that the initial varchar value can grow up and exceed the maximum length of 32 kb. So i wonder if i'm doing everything right (using value stile handling of clob variable) or i'd rather use some recomended approach:
1. Create a clob variable
2. Initialize it by creating a locator assosiated with a temporary table space.
3. Fill the temporary clob object with the intial small text data using dbms_lob.write
4. Modify the clob value accordinally to some business rules.
5. Store the temporary object value where it is required
Thanks in advance. Alex.
Edited by: Timin on Aug 11, 2011 2:13 PM