Insert with 2 clob

Bobo

Member
I do not understand as to make a insert with two field clob.
Please,
someone in particular has a complete example for a insert with two clob (as to pass the values to the fields clob).

Excused and thanks

bobo
 
If you use a Temporary CLOB:
Code:
var
  c1, c2: TLOBLocator;
  Q: TOracleQuery;
begin
  c1 := TLOBLocator.CreateTemporary(Session, otCLOB, True);
  c2 := TLOBLocator.CreateTemporary(Session, otCLOB, True);
  c1.AsString := 'Hello';
  c2.AsString := 'World';
  Q := TOracleQuery.Create(nil);
  Q.Session := Session;
  Q.SQL.Text := 'insert into clob_table (c1, c2) values (:c1, :c2)';
  Q.DeclareVariable('c1', otCLOB);
  Q.DeclareVariable('c2', otCLOB);
  Q.SetComplexVariable('c1', c1);
  Q.SetComplexVariable('c2', c2);
  Q.Execute;
  Q.Free;
  c1.Free;
  c2.Free;
  Session.Commit;
end;
 
Back
Top