TOraStoredProc without procname in odac 9.3.8

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
delphi7
Posts: 15
Joined: Wed 12 Mar 2014 12:28

TOraStoredProc without procname in odac 9.3.8

Post by delphi7 » Sun 25 May 2014 09:09

hi,
i found a problem when i use a TOraStoredProc, without procname (odac 9.3.8), here is an example:
var a,b :string;
begin
try
store:=TOraStoredProc.Create(nil);
store.Session:=session;
if(a='query')then // like a simple query
store.SQL.Text:='select * from student' //like select query
else // like a stored procedure
begin
store.StoredProcName:=b;// b like a procname
store.FetchAll:=True;
store.PrepareSQL;
store.Params.Items[0].DataType:=ftCursor;
end;
if(a='query')then
store.Open
else
Store.execute;
except on E: Exception do showmessage ('error');
end;

the bug was: error storedprocname must be defined

this example works fine when i execute it with odac v9.0.1

thanks

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TOraStoredProc without procname in odac 9.3.8

Post by AlexP » Mon 26 May 2014 08:13

Hello,

The TOraStoredProc component is designed for execution of stored procedures, not queries. To implement the required functionality, you should either use both TOraStoredProc and TOraQuery or use just TOraQuery and the following code:

Code: Select all

if //using stored procedure
then begin
  TDBAccessUtils.CreateProcCall(OraQuery1, 'SP_TEST', true, false);
  OraQuery1.Execute;
end
else begin
  OraQuery1.SQL.Text:='select * from dual;
  OraQuery1.Open;
end;

delphi7
Posts: 15
Joined: Wed 12 Mar 2014 12:28

Re: TOraStoredProc without procname in odac 9.3.8

Post by delphi7 » Mon 26 May 2014 08:34

thanks for this code

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TOraStoredProc without procname in odac 9.3.8

Post by AlexP » Mon 26 May 2014 10:16

You are welcome. Feel free to contact us if you have any further questions.

Post Reply