• Post Reply Bookmark Topic Watch Topic
  • New Topic

Insert Query with auto-incrementing key  RSS feed

 
Chris Weathers
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a users table with a primary key "id" that is set to auto-increment for new insertions. So a new user gets automatically assigned the number of users + 1 for their id.

How does my query from my jsp change in this situation? Do I just leave off the "id" field in the Insert query?
 
Samuel Cox
Ranch Hand
Posts: 96
Scala Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For oracle, mysql, sqlserver, db2?

For db2, I think we used identity_val_local or something like that. For sqlserver, you leave it off.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!