Hi,

I've a unique requirement where the transaction number should be
automatically generated (increment). I can't use AUTO_INCREMENT
column. The TRAN_NO is supposed to be in "YYYYMFFFFF" format, where:

Field: TRAN_NO   CHAR(10)

M = Encoded current month (A: January, B: February, C: March . L:
December)
YYYY = Current year (e.g. 2004, 2005, ...)
FFFFF = Running serial number in hexadecimal format (so the smallest
number is 00001 and the largest number would be FFFFF; the serial
number will reset to 1 at the beginning of each month)

How can I generate this number using MySQL without running into
concurrency problem? Also, this is a web-based app and I am planning
to use PHP for coding. My production environment is MySQL 4.0.17 on
Linux. Development platform is Windows XP with MySQL 4.0.17.

TIA.

Hassan






-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to