Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Insert a row into a table with max id plus 1  RSS feed

 
James Lee
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sona,

I've figured it out using sequence.

Thanks a lot.

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!