File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Identity function in HSQLDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Identity function in HSQLDB" Watch "Identity function in HSQLDB" New topic
Author

Identity function in HSQLDB

saurav sarkar
Ranch Hand

Joined: Jan 07, 2007
Posts: 180

Hi All,

I am using HSQLDB for my application.
I have already created a table with a primary key.
Now i want to modify it and want to make the primary key column also an Auto incrementing one.
I saw in HSQLDB it can be achieved by the IDENTIY() function.

Could please some one please show me the correct SQL syntax for modifying the DDL for the table?.


Thanks and Regards,
Saurav


Be Objectively Oriented.Explore the power of OOPs.
My Blog, Eclipse EMF Query committer.
Angelika Angley
Ranch Hand

Joined: Feb 17, 2009
Posts: 40


[Blog] [SCJP6 75%] [SCBCD]
saurav sarkar
Ranch Hand

Joined: Jan 07, 2007
Posts: 180

Thanks a lot Angelika for the reply.
One more thought on the same lines, could i alter the table definition
because i have already created the table i want to add the identity function
to that.

Angelika Angley
Ranch Hand

Joined: Feb 17, 2009
Posts: 40
You can try this one:


See more here:
http://hsqldb.org/doc/guide/ch09.html#alter_table-section
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Identity function in HSQLDB