That was close but not quite. I have a loop that I have used below, but I
get the same value in each row, I want the loop to a put new value in each
row. So row 1 would have the value of "1" row 2 "2" etc. I tried the
example from terry, but I got an error on the line lnRowID = MyTable.RowID.
My code:
Dim nCount, nNumRows as Integer
nCount = 1
p = TableInfo(msTableName, TAB_INFO_NROWS)
For m = 1 to p
Update msTableName Set Label = nCount + 1
Next
Any suggestions?? TIA
Mike
-----Original Message-----
From: Terry McDonnell [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 12, 2005 2:05 AM
To: [email protected]
Subject: RE: MI-L Updating a Table Column
Mike
Is the following what you mean?
------------------------
DIM lnRowID as SmallInt
Fetch first from MyTable
Do while not EOT( MyTable)
lnRowID = MyTable.RowID
Update MyTable set Label = lnRowID where RowID = lnRowID
Fetch Next from MyTable
Loop
--------------------------
On the other hand, you already HAVE numbered rows in the MyTable.RowID
system field (as used in the example)
HTH
Terry
-----Original Message-----
From: Mayer, Mike @ Vancouver [mailto:[EMAIL PROTECTED]
Sent: 11 May 2005 22:46
To: Terry McDonnell
Subject: MI-L Updating a Table Column
Hello Everyone,
I have a small problem where I am trying to update a column in a table.
I have created a new column in table called "Label" I want to update
this column with numbers 1, 2, 3, each number corresponding to the row
it is in.
I want to be able to do this for an undetermined amount of rows,
meaning, the amount of rows will vary depending on the query. Any
suggestions??
Thanks in advance.
Mike Mayer
(GIS Practicum student....almost finished....)
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16443
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16451
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16458