Page 1 of 1

How to use SQLRefresh with Cursors?

Posted: Sun 06 Aug 2006 18:16
by ozzy
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

Posted: Tue 08 Aug 2006 13:17
by Plash
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.