Reputation: 9
I'm new to programming, so need little help from you guys.
I created a simple registration from in HTML controlled by servlet using oracle. Whenever i submit my record, it gets stored perfectly in database, but I have assigned ID for every stored record which is not appearing to be increment in ascending order even after assigning primary key to ID.
Upvotes: 0
Views: 107
Reputation: 984
There is no short way to auto increment id in database itself. This post describes good way to do it in oracle.
How to create id with AUTO_INCREMENT on Oracle?
Upvotes: 1
Reputation: 1436
Use a database sequence. And increment it by 1 every time you take a new value from that DB sequence.
Upvotes: 0