Calling Function with CLOB Result

lacknerm

Member
Is it possible to call a PL/SQL Function with a Result of CLOB, or is it better to call a Procedure with an out parameter. It would be helpfull if someone can provide a pice of code.

thx Marc
 
Yes, this is possible. Here is a code example. First the PL/SQL Block of a TOracleQuery:
Code:
begin
  :v_clob := my_clob_function(:some_param);
end;
Next, the Delphi code to call this PL/SQL Block and place the CLOB contents in a Memo:
Code:
var
  CLOB: TLOBLocator;
begin
  CLOB := TLOBLocator.Create(MainSession, otCLOB);
  MyQuery.SetVariable('some_param', 100);
  MyQuery.SetComplexVariable('v_clob', CLOB);
  MyQuery.Execute;
  Memo.Lines.LoadFromStream(CLOB);
  CLOB.Free;
end;
This example assumes that you have defined a TOracleQuery instance (MyQuery) with appropriate variable types.

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