Jun 7, 2012

(How To) Create a table in Hypersonic SQL(HSQL) with an auto-increment field



Create table "contacts":
create table contacts(
 id integer generated by default as identity (start with 1 
          increment by 1) not null primary key,
 name varchar(25) not null,
 phone integer not null
)

To insert records into the above table:
insert into contacts(name,phone) values('raja','12345')
insert into contacts(name,phone) values('rams','67890')
 
To view the inserted records:
select * from contacts

No comments:

Post a Comment