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
Register / Login


JavaRanch » Java Forums » Products » Oracle/OAS
Reply 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: 34
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: 34
Hi Sona,

I've figured it out using sequence.

Thanks a lot.

 
 
subject: Insert a row into a table with max id plus 1
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture