How do I create a foreign key from the child table that references a UNIQUE key in the parent table? I have a table named employee with a field emp_id. I want to add an entry in the table every 10 minutes if the max value of emp_id is 10. After 10 minutes I want to add an entry in the table with value 11. And after 10 minutes, another entry must be added with the value 12, and so on.
The alter table command listed below is an example of how to create a foreign key that references a parent table. The field in the parent table can be either a UNIQUE key or a PRIMARY key. These keys can also be concatenated keys.
ALTER TABLE child_table ADD
FOREIGN KEY (FRPP_RUN_ID)
REFERENCES parent_table (FRPP_RUN_ID) ENABLE
The job procedure below inserts an ID that is incremented by 1 every 10 minutes, into the table TEST.
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
job => X
,what => 'insert into table test (ID)
,next_date => to_date('27/08/2006 17:41:13','dd/mm/yyyy hh24:mi:ss')
,interval => 'SYSDATE+10/1440 '
,no_parse => FALSE