TZQuery and Output Params

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
AlbertoIT
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 08.03.2006, 11:22

TZQuery and Output Params

Post by AlbertoIT »

Hi i'm new friend,
i'm using zeos 6.5.1 conponent in lazarus to work with oracle XE (free version of 10g) and i've same problem to keep back output param's value. I tried to use TZStoredProc but i had an unsupported operation exception (i think is because zeos support only oracle 9i).
So i changed the code and now i'm using TZQuery to call Stored Procedure in oracle:

Code: Select all

ZQuery1.SQL.Add('Declare'); 
  ZQuery1.SQL.Add('Begin'); 
  ZQuery1.SQL.Add('PKGESTIONEPEZZI.PrCicloMng (:lTipOpe, :lTipoCiclo, :lDescrizione, :lDurataConf, :errdiag);'); 
  ZQuery1.SQL.Add('End;'); 
  ZQuery1.Params.CreateParam(ftUnknown,  'lTipOpe',      ptInput); 
  ZQuery1.Params.CreateParam(ftUnknown,  'lTipoCiclo',   ptInput); 
  ZQuery1.Params.CreateParam(ftUnknown,  'lDescrizione', ptInput); 
  ZQuery1.Params.CreateParam(ftUnknown, 'lDurataConf',  ptInput); 
  ZQuery1.Params.CreateParam(ftUnknown, 'errdiag',  ptInputOutput); 
  ZQuery1.ParamByName('lTipOpe').Value := 'I'; 
  ZQuery1.ParamByName('lTipoCiclo').Value := ComboBox1.Text; 
  ZQuery1.ParamByName('lDescrizione').Value := Des.Text; 
  ZQuery1.ParamByName('lDurataConf').Value := 'null'; 
  ZQuery1.ParamByName('errdiag').Value := 'null';    
  ZConnection1.StartTransaction; 
  ZQuery1.ExecSQL; 
  label3.Text := String (ZQuery1.ParamByName('errdiag').Value); 
  ZConnection1.Commit; 
Where PrCicloMng is my stored in PKGESTIONEPEZZI package and it has 4 params input and just 1 output, i'm able to call procedure but i cannot get back 'errdiag' param.
Anybody can help me?
Post Reply