How to use SQLRefresh with Cursors?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ozzy
Posts: 3
Joined: Fri 28 Jul 2006 14:17

How to use SQLRefresh with Cursors?

Post by ozzy » Sun 06 Aug 2006 18:16

How to use SQLRefresh with Cursors?
for example:

Query1->SQL->Text="begin :Cur:=DL.LOADER(:CODE,:PAR1,:PAR2,:PAR3); end;";
(inside simple SQL like this: select * FROM employees )

Query1->SQLRefresh->Text= ?

Thanks

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

Post by Plash » Tue 08 Aug 2006 13:17

To use SQLRefresh you can add to the stored procedure parameter that identifies current row in dataset. In code of the stored procedure check this parameter and if its value is not NULL than use SQL that will return only values for current row. For example:

Code: Select all

SELECT * FROM employees
WHERE id = p_id
In SQLRefresh property write SQL:

Code: Select all

BEGIN
  :Cur:=DL.LOADER(:CODE,:PAR1,:PAR2,:PAR3, :ID);
END;
If you cannot make such changes in the stored procedure you should fully refresh the dataset with Refresh method.

Post Reply