Hi,
We are using NAV 5.0 SP1 and SQL 2012.
I have a scenerio where I have to deal with the First Record in a record set differently than the rest of the records in the recordset;
I know using repeat..until inside FIRSTFIRST is not recommended.
So I was wondering between (A) and (B) which would be better performing:
(A)
IF FINDSET then begin
if FirstRecordFlagVar then begin
Do Something with the First record in the recordset;
end
else begin
repeat
Do Something with other records in the recordset;
until NEXT=0;
end;
end;
(B)
IF FINDFIRST then begin
Do Something with the First record in the recordset;
While (NEXT<>0) Do begin
Do Something with other records in the recordset;
end;
end;
(I am losing the indentation in the preview, sorry for that)
(It's second time I am posting it, last time my post was lost to oblivion, when I mistakenly did not put the Subject Line, may be webmaster can take care of it)
Thanks
Fazle
0
Comments
But in C/Side Reference Guide they are saying:
You should only use this(FINDSET) function when you explicitly want to loop through a recordset. You should ONLY use this function in combination with REPEAT .. UNTIL
So WHILE Loop can be used inside FINDSET?
Thanks
Yeah, you can do that. Only the "NEXT" actually generates a server call.
Also use the [ code ] tags like MBerger has done to keep the formatting on your code.
- Reinhard
=D> =D> =D>