The forum is currently being migrated to a new host. While the migration happens, the old server is still available. Once the new machine is ready, I will copy the database to the new machine. Feel free to ask and answer questions in the meantime.

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);

asked 15 Jan '10, 00:51

Calvin%20Allen's gravatar image

Calvin Allen
accept rate: 25%

You can make a call to

select get_identity('people') from dummy;

which will get the next available number for that table.

permanent link

answered 15 Jan '10, 00:52

Calvin%20Allen's gravatar image

Calvin Allen
accept rate: 25%


Excellent information! Thanks!

(15 Jan '10, 14:35) Calvin Allen
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 15 Jan '10, 00:51

question was seen: 1,035 times

last updated: 15 Jan '10, 00:52