If you want to use a sequence to automatically popluate the column at each insert, you can alter the column to support this with the below syntax:
ALTER TABLE myschema.mytable ALTER COLUMN id SET DEFAULT nextval('myschema.mysequence'::regclass);
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
ALTER TABLE myschema.mytable ALTER COLUMN id SET DEFAULT nextval('myschema.mysequence'::regclass);
No comments:
Post a Comment