I am a newbie with database. And I would be most grateful if someone could help me out.
I have a table, say "st_order" which has a field name,"id" as primary key. What I want to do, is to add a record to this table, even though at the time of addition, I don't have or know the id.
My concern is how do I autogenerate this primary key. Is there a way to do so in Oracle?If yes, how?
tamarahz is new to database, joachim, so the trigger is probably too confusing
tamarahz, are you asking whether you can assign your own value to the primary key sometimes, and let an autonumber be assigned other times? if so, that's weird, and maybe you should rethink the primary key
if all you want is an autonumber in oracle, look up CREATE SEQUENCE in the docs