Page 1 of 1

[resolve] parameter in clob in a stored procedure

Posted: Fri 31 Aug 2007 12:12
by hip
Hey,

--Odac V5.55.1.26
--Delphi7
--Oracle 9.2.0.1.0

I try to use a clob parameter in in a pl/sql procedure

I do this

:arrow:

Code: Select all

PROCEDURE test(cl OUT CLOB) IS
test varchar2(200);
BEGIN
test:='test';
--cl:=EMPTY_CLOB;
dbms_lob.createtemporary(cl,false,10);
DBMS_LOB.write(cl,length(test),dbms_lob.getlength(cl)+1,test);
END;
:arrow:

Code: Select all

procedure TTest.ButtonClick(Sender: TObject);
var
oc: TOraLob;
ws : widestring;
begin
   With DATA.oratest do
   begin
   execProc;
      try
      oc:=DATAMODDMP.oratest.Params[0].AsOraClob;
      ws:=oc.AsWideString;
      messagedlg(ws,mtwarning,[mbOk],0);
      oc.FreeLob;
      close;
      finally
      free;
      end;
   end;
end;
it works but I would to know if all is correct or if I must do anything else :roll:

thx a lot :)

Posted: Mon 03 Sep 2007 07:42
by Plash
Your code is correct.

Posted: Mon 03 Sep 2007 08:04
by hip
thx