• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I store USERID automatically in Oracle

 
subir adhikari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a simple servlet program I am creating profiles for different persons registering with the application.The related "registration" table has a "USERID" column where the users' unique "USERID" will be stored. Now I have another table named "MEAL" which has the same column "USERID" which is primary key to "registration" table. When an user will select a meal to be taken from meal selection page corresponding meal data are saved to "MEAL" table.Now I wish the corresponding USERID to be automatically stored in the "USERID" column of the "MEAL" table. So how can I achieve this functionality?Please help me on this!!
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "automatically"?
 
mallikarjun dontamsetti
Ranch Hand
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how the user is taking meals? how you are identifying which user is taking meals? if you now that user, who is taking meals you can get that "USERID" value(because it is a primary key) and insert it in the meals table.
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, exactly. Why not just store the user value in the table just the same way you store the meal value?
 
subir adhikari
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I user session and solved the issue!!Thanks!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic