A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
video training course this week in the
JDBC and Relational Databases
Generating primry keys
Joined: May 15, 2007
Jun 02, 2007 20:41:00
Friend How can I create unique primary keys in
or in mysql.
Please read this...........
There are lot of speed posts(type of mail/letter) are accepted in our postoffices. I need to uniquely identify them. I thought to generate a unique id like this.
Say its 04thJune07 then
the ids will propogate like 040607(a unique post office id - 5 digits)(auto increment letter id)
For example 040607907361
040607 is the date, 90736 is the post office code (there are unique code for every post offices), 1 is the autoincrement no.
Can any body help me?
Author and ninkuma
Joined: Jan 10, 2002
Jun 02, 2007 21:03:00
Please take the time to choose the correct forum for your posts. This forum is for questions on
This post has been moved to a more appropriate forum.
Asking smart questions
Books by Bear
Joined: Nov 18, 2006
Jun 02, 2007 21:53:00
Here's a Google search command that searches the official mysql site for autoincrement within a CREATE TABLE SQL command:
create table autoincrement site:www.mysql.com
It is sorta covered in the
JavaRanch Style Guide
subject: Generating primry keys
reading from a properties file
help with keylistener
Why use a Unique Key when you can use a Primary Key?
Map Interface on SCJP
generate unique fixed length code from a string
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015