How to get then Count of UniQuery.OpenNext

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
daizhicun
Posts: 109
Joined: Thu 21 Jan 2010 11:49

How to get then Count of UniQuery.OpenNext

Post by daizhicun » Mon 15 Nov 2010 13:41

at sqlserver:

you can write:
UniQuery.sql.text:='select 1 select 2 select 3 ';
UniQuery.open;
UniQuery.OpenNext;
UniQuery.OpenNext;


but can it write as:

UniQuery.sql.text:='select 1 select 2 select 3 ';
UniQuery.open;
for i:=2 to UniQuery.OpenCursorCount
begin
UniQuery.OpenNext;
end;


in fact ,I want to know how many DataSet in a SQL of UniQuery.Sql when it be executed.

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

Post by AlexP » Mon 15 Nov 2010 14:22

Hello,

You can use the following code:

var
counter: integer;
begin
counter:=0;
UniQuery1.sql.Clear;
UniQuery1.sql.text:='select 1 select 2 select 3 ';
UniQuery1.Open;
repeat
inc(counter);
until not UniQuery1.OpenNext;

Post Reply