Blob, Null values and SetEmpty

Roeland

Member³
Hi,

When retrieving a BLOB form an oracle method, I check if it's allocated.

If not, I perform a SetEmpty on this BLOB variable. But this seems to have no effect.

Oracle:

Code:
procedure Get_Blob (p_id in Test.Id%type,
                    p_Blob out NOCOPY Test.Foto%type) is
begin
  select Foto into p_Blob
  from Test
  where id = p_Id
  for update;
end Get_Blob;

Delphi:

Code:
procedure...
var
  mBlob: TLobLocator;
begin
  Test_Package.GetBlob (1, // Id
                        mBlob);

  if mBlob.IsNull then
    mBlob.SetEmpty;

  ...
  Commit;
end;

Is this a bug, or is it not possible for you to set the locator?
With other words, should the SetEmpty method invoke Empty_Blob() or is this not possible?

Roeland
 
The packaged function will return a temporary BLOB. Setting it to empty will not have any effect. You will have to execute an update statement and pass an empty_blob().
 
Back
Top