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!

how to generate id number?

Status
Not open for further replies.

marc79

Programmer
Apr 5, 2005
18
PH
I'm working on this project where i have to generate an id number.
On my page, i use a SQLExec statement to get the max number of entries for this table. Then, i increment that number by 1 and that's how i ensure that the id is unique. I have to display this id in a scroll area, which is where i run into trouble. My approach works fine if the user keeps saving each entry in the scroll before adding a new one.
On the other hand, if they just want to add an entry, the id number wont increment because the last entry hasn't been saved yet (hence, my sqlExec statement still retrieves the old max number from the database). I tried to increment variables instead but ran into problems. Does anybody know of an easy solution? Sorry, i'm a PeopleSoft newbie. Appreciate any advise.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top