CREATE TABLE T1 (
ID NUMBER
)
Table created.
CREATE TABLE T2 (
ID NUMBER,
T1_ID NUMBER
)
Table created.
CREATE SEQUENCE seq_t1
Sequence created.
CREATE SEQUENCE seq_t2
Sequence created.
INSERT ALL
INTO T1 ( ID ) VALUES ( seq_t1.nextval )
INTO T2 ( ID, T1_ID ) VALUES ( seq_t2.nextval, seq_t1.nextval)
SELECT *
FROM DUAL
CONNECT BY LEVEL <= 10
20 row(s) inserted.
SELECT * FROM T1
ID | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|
SELECT * FROM T2
ID | T1_ID | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 | 5 | 6 | 6 | 7 | 7 | 8 | 8 | 9 | 9 | 10 | 10 |
---|
DROP TABLE T1
Table dropped.
DROP TABLE T2
Table dropped.
DROP SEQUENCE seq_t1
Sequence dropped.
DROP SEQUENCE seq_t2
Sequence dropped.