SQL> desc test;
Name Type Nullable Default Comments
---- ------ -------- ------- --------
ID NUMBER Y
N NUMBER Y
SQL> alter table test modify n char(1);
Table altered
SQL> desc test;
Name Type Nullable Default Comments
---- ------- -------- ------- --------
ID NUMBER Y
N CHAR(1) Y
SQL> insert into test values(1,'a');
1 row inserted
SQL> insert into test values(2,'b');
1 row inserted
SQL> insert into test values(3,'c');
1 row inserted
SQL> insert into test values(4,'d');
1 row inserted
SQL> insert into test values(5,'f');
1 row inserted
SQL> insert into test values(6,'g');
1 row inserted
SQL> commit;
Commit complete
SQL> create table a(id number,n char(1));
Table created
SQL> create table b(id number,n char(1));
Table created
SQL> insert all into a into b select * from test;
12 rows inserted
SQL> commit;
Commit complete
SQL> select * from a;
ID N
---------- -
1 a
2 b
3 c
4 d
5 f
6 g
6 rows selected
SQL> select * from b;
ID N
---------- -
1 a
2 b
3 c
4 d
5 f
6 g
6 rows selected
SQL> delete from a;
6 rows deleted
SQL> delete from b;
6 rows deleted
SQL> commit;
Commit complete
SQL> insert first when id >= 3 then into a when id >=5 then into b select * from test;
4 rows inserted
SQL> select * from a;
ID N
---------- -
3 c
4 d
5 f
6 g
SQL> select * from b;
ID N
---------- -
SQL> rollback;
Rollback complete
SQL> insert first when id >= 5 then into a when id >=3 then into b select * from test;
4 rows inserted
SQL> select * from a;
ID N
---------- -
5 f
6 g
SQL> select * from b;
ID N
---------- -
3 c
4 d
SQL> rollback;
Rollback complete
SQL> insert all when id >= 3 then into a when id >=5 then into b select * from test;
6 rows inserted
SQL> select * from a;
ID N
---------- -
3 c
4 d
5 f
6 g
SQL> select * from b;
ID N
---------- -
5 f
6 g
SQL> rollback;
Rollback complete
SQL> drop table a;d
Table dropped
SQL> drop table b;
Table dropped
SQL>
Name Type Nullable Default Comments
---- ------ -------- ------- --------
ID NUMBER Y
N NUMBER Y
SQL> alter table test modify n char(1);
Table altered
SQL> desc test;
Name Type Nullable Default Comments
---- ------- -------- ------- --------
ID NUMBER Y
N CHAR(1) Y
SQL> insert into test values(1,'a');
1 row inserted
SQL> insert into test values(2,'b');
1 row inserted
SQL> insert into test values(3,'c');
1 row inserted
SQL> insert into test values(4,'d');
1 row inserted
SQL> insert into test values(5,'f');
1 row inserted
SQL> insert into test values(6,'g');
1 row inserted
SQL> commit;
Commit complete
SQL> create table a(id number,n char(1));
Table created
SQL> create table b(id number,n char(1));
Table created
SQL> insert all into a into b select * from test;
12 rows inserted
SQL> commit;
Commit complete
SQL> select * from a;
ID N
---------- -
1 a
2 b
3 c
4 d
5 f
6 g
6 rows selected
SQL> select * from b;
ID N
---------- -
1 a
2 b
3 c
4 d
5 f
6 g
6 rows selected
SQL> delete from a;
6 rows deleted
SQL> delete from b;
6 rows deleted
SQL> commit;
Commit complete
SQL> insert first when id >= 3 then into a when id >=5 then into b select * from test;
4 rows inserted
SQL> select * from a;
ID N
---------- -
3 c
4 d
5 f
6 g
SQL> select * from b;
ID N
---------- -
SQL> rollback;
Rollback complete
SQL> insert first when id >= 5 then into a when id >=3 then into b select * from test;
4 rows inserted
SQL> select * from a;
ID N
---------- -
5 f
6 g
SQL> select * from b;
ID N
---------- -
3 c
4 d
SQL> rollback;
Rollback complete
SQL> insert all when id >= 3 then into a when id >=5 then into b select * from test;
6 rows inserted
SQL> select * from a;
ID N
---------- -
3 c
4 d
5 f
6 g
SQL> select * from b;
ID N
---------- -
5 f
6 g
SQL> rollback;
Rollback complete
SQL> drop table a;d
Table dropped
SQL> drop table b;
Table dropped
SQL>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22745099/viewspace-624820/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22745099/viewspace-624820/