CLOB with stpred procedure error

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
LOBproblem

CLOB with stpred procedure error

Post by LOBproblem » Wed 16 Nov 2005 09:09

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

Guest

Interview

Post by Guest » Wed 16 Nov 2005 22:14

LOBproblem wrote:Hello, can anybody help me with my problem? How can I send String into CLOB parameter ?
So when will we know more

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Thu 17 Nov 2005 10:33

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

Post Reply