Unable to insert NULL value for TLobLocator

Martin B

Member²
I'm having trouble setting the value of a TLobLocator to null -- upon insert I always get an empty CLOB instead of a NULL vaule.

I have tried using the SetEmpty as well as setting the AsString property of the TLobLocator to an empty string (MyLobLocator.AsString := '').

Also when useing SetEmpty with the Free method I get the an error: TLobLocator: Invalid Handle

TOracleSession.NullLobIsEmpty := False
TOracleSession.NullObjectIsEmpty := False

Any ideas?

DOA: 4.0.7
Delphi: 2006 (Version 10.0.2288.42451)
Oracle: 9.2.0.7.0
OCI: 9.2.0.7.0

Code Example:

procedure TCenterLogDirectory.Save;
var
DirectoryContentsLOB: TLOBLocator;
begin
try
// Obtain a Temporary CLOB
DirectoryContentsLOB := TLOBLocator.CreateTemporary(MainSession, otCLOB, False);

// Results in an empty CLOB, not Null Value
DirectoryContentsLOB.AsString := '';

// If using DirectoryContentsLOB.SetEmpty; Error is raised when calling DirectoryContentsLOB.Free below.
// Commenting out DirectoryContentsLOB.Free; results in an empty CLOB inserted
// DirectoryContentsLOB.SetEmpty;

with qryInsertCenterlogDirectory do
begin
SetComplexVariable('p_directory_contents', DirectoryContentsLOB);
Execute;
end; // with qryInsertCenterlogDirectory

finally
// FREE LOB Allocation
if DirectoryContentsLOB nil then
DirectoryContentsLOB.Free;
end;
end; // save
 
>Also when useing SetEmpty with the Free method I get the an error: TLobLocator: Invalid Handle

This issue seems same as what i've reported just now here
ttp://www.allroundautomations.com/ubb/ultimatebb.php?ubb=get_topic;f=1;t=002734
 
Back
Top