Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign Next Value

Status
Not open for further replies.

carolynh

Programmer
Feb 13, 2004
44
US
I need to programmically create a new record in a table that has a field that typically is auto incremented when a user creates a record in the UIB portion of the application. How can I auto-increment this value when I programmically create the record. I have tried to do a Find-last on the table, but it is pulling up a record with a RecSeq of 000000036 and I know the last sequence number is 00000076.
Thanks
Carolyn
 
Did you tried find-last with use-index?
If not:
You have to define index (ascending) on field that is auto-incremented.
Then you use FIND LAST like this:

FIND LAST record USE-INDEX index.
 
Why not use a Progress Sequence ? That way you don't need to lookup the last record to increment the sequence number. See the help on the NEXT-VALUE function for more info.

Mike.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top