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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ID Field

Status
Not open for further replies.

wuxapian

Programmer
Jun 13, 2001
52
GB
Hi,

I need to create a table with one record in it that stores a number. This number will then be accessed and then incremented by an application, which requires a sequential but unique number as part of a product code.

Does anyone know of a reliable method for grabbing and then incrementing a value from a table bearing in mind that multiple users could be using it at the same time?

TIA
Wux.
 
this should work

1. LOCK TABLES table_name WRITE;
3. UPDATE tablename SET int_column = (int_column + 1);
4. UNLOCK TABLES;
 
Thanks for that piti, I will give it a go.

Wux.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top