Quantcast

auto increment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

auto increment

salvatore fusto
Hi all, new to this group.
I'm testing this engine, but i've a problem: i define a table, with a
primary key, identity and autoincrement, but in inserting any row,
i've always to specify the value of this key, eithr with code or using
the console.
what is the exact sintax to define a primaty key with autoicrement, so
i don't have to specify its value in insert?
regards
salvatore

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto increment

Kerry Sainsbury
This works for me:

create table blah (id identity, name varchar);

insert into blah(name) values ('bob');

select * from blah;

Cheers
Kerry

On Thu, Feb 11, 2010 at 5:45 AM, salvatore fusto <[hidden email]> wrote:
Hi all, new to this group.
I'm testing this engine, but i've a problem: i define a table, with a
primary key, identity and autoincrement, but in inserting any row,
i've always to specify the value of this key, eithr with code or using
the console.
what is the exact sintax to define a primaty key with autoicrement, so
i don't have to specify its value in insert?
regards
salvatore

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.


--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
Loading...