You would need to create an automatic sequence.
<pre>CREATE SEQUENCE <sequence_name>
INCREMENT BY <integer>
START WITH <integer>
MAXVALUE <integer> / NOMAXVALUE
MINVALUE <integer> / NOMINVALUE
CYCLE / NOCYCLE
CACHE <#> / NOCACHE
ORDER / NOORDER;</pre>
When entering a record, the customer number would be <sequence_name>.NEXTVAL.
Insert into <table_name> values <sequence_name>.NEXTVAL, <email_address>, etc.
That would be for Oracle.
If you are using SQL (you didn't specify) you specify this when you create the table. It's called an IDENTITY field.
<pre>CREATE TABLE MyTable
(Id_Column INT IDENTITY(1,1) PRIMARY KEY,
EmailAddress nvarchar(255),
FullName nvarchar(255))</pre>
Last Wiki Answer Submitted: January 24, 2008 7:29 am by Seashellm150 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Many DMBS now have an auto increment, integer datatype which does exactly what you want
Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.