Topic: Insert same ID in both tables simultaneously
Help please, there are 2 tables table1 and table2.
Columns in 1st table Employeer_ID
Columns in 2nd table ID, Employeer_ID
It is necessary one and too sequence in both tables
[url =] DECLARE v_table1_sequence NUMBER; BEGIN FOR elem in 1. 50 v_sequence: = SEQUENCE_NAME.NEXTVAL INSERT INTO table1 values (v_table1_sequence); END; FOR elem in 1. 50 v_sequence: = SEQUENCE_NAME.NEXTVAL INSERT INTO table2 values (TABLE2.SEQUENCE.NEXTVAL, v_table1_sequence); END; [/url]
In 1st table of value norms that is 1,2,3,4,5 counter works, and in 2nd table the same counter one and too value, that is in all 50 lines only value 1.
It is to volume-that the counter it is twisted in 1st cycle, and to 2nd does not react. Tried to deduce a variable v_table1_sequence for unit repartition produces an error.
Help one and too value sequence in both tables.
In advance thanks