Page 1 of 1

CLOB with stpred procedure error

Posted: Wed 16 Nov 2005 09:09
by LOBproblem
Hello, can anybody help me with my problem? How can I send String into CLOB parameter ?

for example I have stored procedure:

create or replace procedure ProcessClob(clDATA in clob)
as
begin
null;
end;

I can't change procedure parameter type on OUT, and i must use TOraStoredProc.

On client side code like this:

procedure MyClass.Process(const AString: String);
begin
with TOraStoredProc.Create(nil) do
try
StoredProcName := 'ProcessClob'
{ .... how create temporary LOB using odac and send it to stored proc? ?
ParamByName('clDATA').AsString := AString;
Execute;
finally
Free;
end;
end

Interview

Posted: Wed 16 Nov 2005 22:14
by Guest
LOBproblem wrote:Hello, can anybody help me with my problem? How can I send String into CLOB parameter ?
So when will we know more

Posted: Thu 17 Nov 2005 10:33
by Alex
Try to use the following code.

Code: Select all

procedure MyClass.Process(const AString: String); 
var
  OraClob: TORalob;
begin 
  OraClob := TORalob.Create(OraSession1.OCISvcCtx);
  OraClob.CreateTemporary(ltClob);
  OraClob.AsString := AString;
  OraClob.WriteClob;
  with TOraStoredProc.Create(nil) do 
    try 
      StoredProcName := 'ProcessClob' ;
      Prepare;
      ParamByName('clDATA').AsOraCLOB := OraClob;
      Execute; 
   finally 
     Free; 
   end; 
end