Representation for client
Steve, February 20, 2007 - 12:26 pm UTC
Does Oracle send an indicator to the client when a value is absent that would be interpreted as null? Or does Oracle send two column separaters (e.g. like ",," in a csv file)?
Also, what is the advantage in using emply_clob() (as opposed to leaving as null)? I've seen default values set as empty_clob() and am not sure of the reason.
Thanks,
Steve
February 20, 2007 - 2:59 pm UTC
the protocol is a bit more complicated than ',,'
yes, there would be a null flag.
As for the empty_clob() - it depends on the needs of the application - does it need an "empty file ready to accept data" or does it need "the absence of a file"
Why non-null requirement?
Steve, February 21, 2007 - 8:45 am UTC
Regarding empty_clob(), I should have read the LOB Developers Guide closer, it does explicitly state:
"Before you can start writing data to an internal LOB using the supported programmatic environment interfaces (PL/SQL, OCI, OCCI, Pro*C/C++, Pro*COBOL, Visual Basic, Java, or OLEDB), the LOB column/attribute must be made non-null, that is, it must contain a locator. You can accomplish this by initializing the internal LOB to empty in an INSERT/UPDATE statement using the functions EMPTY_BLOB() for BLOBs or EMPTY_CLOB() for CLOBs and NCLOBs."
But why is this? Isn't an insert an insert no matter who calls it (straight SQL vs. those listed above)? Does it have to do with obtaining the locator?
Thank you.
Steve
February 21, 2007 - 11:08 am UTC
the key thing here is "before you can start writing to a LOB using an API, you need something to write to"
You need a "file" - a lob locator - to write to
if you don't have one, you cannot programatically write to it.