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>
Discuss This Question: 2  Replies