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
CLOB with stpred procedure error
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