Simply add a condition:
...
If SelectionInfo(SEL_INFO_NROWS) > 0 Then
Fetch First From Selection
Do while not EOT(Selection)
Loop
End If
Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
COWI A/S
Odensevej 95
5260 Odense S.
Denmark
Tel + 45 6311 4900
Dir +45 6311 4908
Mob +45 5156 1045
Fax + 45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk <http://www.cowi.dk/>
________________________________
From: Rena Jones [mailto:[EMAIL PROTECTED]
Sent: Fri 18-Jun-04 15:07
To: [EMAIL PROTECTED]
Subject: MI-L Do-Loop when selection not available
Hi all-
I have a Do loop that works on a query. How do I make it so that if the selection
doesn't exist,
it skips the do loop? This runs on a batch of many files and some of my files do not
contain the
data in the query and I get an error message "selection cannot be accessed as a table"
and the
whole process is halted.
The code I have now, which works great (when the query is fulfilled) is this:
Select * from LEWI04s1 where Instr(1,CFCC,"A2") Into Selection
Fetch First From Selection
Do while not EOT(Selection)
VarObj = Selection.obj
nRowID = Selection.ROWID
Alter Object VarObj
Info OBJ_INFO_PEN, change2
update selection set obj = VarObj
Where ROWID = nRowID
Fetch Next From Selection
'count = count + 1
Loop
Thanks for your help. This list is great.
RJ
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 12281