Passing clob as IN parameter

hoyman

Member
I am receiving the "ORA-22275: invalid LOB locator specified" when passing a clob parameter to a stored procedure.

The problem is the procedure takes a clob NOT to update a database column with parameter contents (which I know how to handle using in out parameter), but only to pass it to further processing, like in the following example:

PROCEDURE validateDefinition (ipRuleDefinition in CLOB) as
begin
if ipRuleDefinition is not null and
length(ipRuleDefinition)>0 then
-- parse the definition and validate it
-- ...
end if;
end;

Here is my Delphi that call this procedure:

with oqValidateDefinition do begin
LOB := TLOBLocator.Create(Session, otCLOB);
LOB.SetEmpty;
SetComplexVariable('DEFINITION', LOB);
Execute;
Lob.AsString := 'sample definition';
end;

------------------
 
This requires temporary LOB support, which is a new feature in the upcoming 4.0 (currently in beta). In 4.0 you can do the following:
Code:
with oqValidateDefinition do begin
  LOB := TLOBLocator.CreateTemporary(Session, otCLOB, True);
  Lob.AsString := 'sample definition';
  SetComplexVariable('DEFINITION', LOB);
  Execute;
end;

------------------
Marco Kalter
Allround Automations
 
Back
Top