Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning an Incremental Field Value in SQL
Message
From
30/04/2004 08:50:42
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Returning an Incremental Field Value in SQL
Miscellaneous
Thread ID:
00899694
Message ID:
00899694
Views:
50
I'm trying to return 1 for the value of the UniqueID field in the first record and then increment each subsequent record in MyCursor. The SQL below returns all "1" in the resulting records. I'm sure this is because the pointer does not move in MyTable, but there must be a simple way. I was lookng at AutoInc, but that doesn't seem to be applicable to cursors. We have a GetNext functionality for tables but I don't need it here. I'm sure it's simple, but it's not coming to me right now.
SELECT ;
   MyTable.Field1, ;
   RECNO('MyTable') AS UniqueID ;
   FROM MyTable ;
   INTO CURSOR MyCursor
Next
Reply
Map
View

Click here to load this message in the networking platform