How to refresh TOraQuery with cursor assigned from TOraStoredProc or TOraSQL

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Infomaster
Posts: 6
Joined: Mon 11 Jan 2010 13:26

How to refresh TOraQuery with cursor assigned from TOraStoredProc or TOraSQL

Post by Infomaster » Mon 08 Feb 2010 14:58

Hi!

I have some procedure in my DB:

Code: Select all

procedure MyProc(
  Cur1 SYS_REFCURSOR,
  Cur2 SYS_REFCURSOR,
  Cur3 SYS_REFCURSOR
);
BEGIN
  OPEN Cur1 FOR
    ...
  OPEN Cur2 FOR
    ...
END;
I'm using this cursors by three datasets of TOraQuery:

Code: Select all

MyOraSQL.Execute;
MyOraQuery1.Cursor := MyOraSQL.ParamByName('Cur1').AsCursor;
MyOraQuery1.Open;
MyOraQuery2.Cursor := MyOraSQL.ParamByName('Cur2').AsCursor;
...
When i want to refresh one of them i must do this:

Code: Select all

MyOraSQL.Refresh;
MyOraQuery1.Close;
MyOraQuery1.Cursor := MyOraSQL.ParamByName('Cur1').AsCursor;
MyOraQuery1.Open;
Maybe I doing it wrong? How can i refresh it more effectively?
(MyOraQuery1.Refresh does'nt work, it answers to me "Reopen is not allowed")

(Oracle 9.2, Oracle Client 8, Delphi 5, Windows XP)

Thanks!

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

Post by Plash » Tue 09 Feb 2010 08:38

There is no more efficient way.

Post Reply