[resolve] parameter in clob in a stored procedure

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
hip
Posts: 6
Joined: Thu 02 Aug 2007 11:33

[resolve] parameter in clob in a stored procedure

Post by hip » Fri 31 Aug 2007 12:12

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 :)
Last edited by hip on Mon 03 Sep 2007 08:05, edited 1 time in total.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 03 Sep 2007 07:42

Your code is correct.

hip
Posts: 6
Joined: Thu 02 Aug 2007 11:33

Post by hip » Mon 03 Sep 2007 08:04

thx

Post Reply