on 2010 Jan 15 12:51 AM
If I had a table defined like below, how, from my application would I be able to get the next value for the "id" column before saving any data to the database?
create table people
(
id not null default global autoincrement(100000),
first_name varchar(100),
last_name varchar(100)
);
alter table "people"
add constraint PK_PEOPLE primary key (ID);
Request clarification before answering.
You can make a call to
select get_identity('people') from dummy;
which will get the next available number for that table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excellent information! Thanks!
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.