Print Thread
Unable to insert NULL value for TLobLocator
#9494 08/31/07 09:10 PM
Joined: Aug 2005
Posts: 16
Philadelphia, PA
M
Member
OP Offline
Member
M
Joined: Aug 2005
Posts: 16
Philadelphia, PA
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

Re: Unable to insert NULL value for TLobLocator
#9495 09/01/07 12:45 AM
Joined: Sep 2004
Posts: 46
P
Member
Offline
Member
P
Joined: Sep 2004
Posts: 46
>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


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.059s Queries: 13 (0.032s) Memory: 2.5008 MB (Peak: 3.0418 MB) Data Comp: Off Server Time: 2024-05-14 11:51:15 UTC
Valid HTML 5 and Valid CSS