wood burning stoves*
The moose likes Oracle/OAS and the fly likes Insert a row into a table with max id plus 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Insert a row into a table with max id plus 1" Watch "Insert a row into a table with max id plus 1" New topic
Author

Insert a row into a table with max id plus 1

James Lee
Ranch Hand

Joined: Oct 16, 2006
Posts: 36
Hi,

Can anyone show me how to do it? Basically something like this: but it's not working.

It can be done with two queries but I'm wondering if it can be done with only one query.

Thanks.
Sona Patel
Ranch Hand

Joined: Mar 30, 2009
Posts: 75
Hi James,

Check this http://www.coderanch.com/t/81154/Oracle-OAS/Using-Select-query-inside-insert

which version of oracle are you using?
James Lee
Ranch Hand

Joined: Oct 16, 2006
Posts: 36
Hi Sona,

I've figured it out using sequence.

Thanks a lot.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Insert a row into a table with max id plus 1
 
Similar Threads
Obtaining auto created id upon finishing insert
how to know the last auto-increment number using JDBC
problem with MS Access and max
Newbie validation with textfile
SQL statment into a method