id problem [message #79102] |
Wed, 24 April 2002 08:48  |
massa
Messages: 12 Registered: April 2002
|
Junior Member |
|
|
I have a table which contain a column - named 'id' - and I would like to know which sort of type should I give to this colunm because I would like this column to auto upgrade each time I insert a new row like this :
id name password
1 John Jo1254
2 Ralf Ra6871
3 Chris Ch9874
For example, if a new person wants to have a password, this person has only have to give his name and his password and it will add a new line with id=4.
If somebody has an idea, please suggest.
Christophe
|
|
|
Re: id problem [message #79113 is a reply to message #79102] |
Fri, 26 April 2002 16:53  |
Jr.Z
Messages: 1 Registered: April 2002
|
Junior Member |
|
|
Try create a sequence in SQL plus:
Create sequence CustomerID increment by 1 start with 1000;
NB: '1000' -whatever number you like.
While you insert a new row:
Insert into TableName(ID,NAME,PASSWORD) VALUES (CustomerID.NEXTVAL,'PERSON','PASSWORD');
|
|
|