aspose file tools*
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
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.

 
jQuery in Action, 2nd edition
 
subject: Insert a row into a table with max id plus 1