Tips
In Oracle, A primary key cannot contain a NULL value.
But try the below..
Create table t1
(
col1 varchar2(30) null,
col2 varchar2(40),
add constraint col1_pk PRIMARY KEY ( col1 )
);
--The above is created successfully
TRICK
To copy a large table , use Oracle hint APPEND with Insert statement as below.
Consider the table TABLE1 having huge set of records ( > 10M rows )..
Create table TABLE1_copy
as
Select *
from TABLE1
where 1=2;
Insert /*+append*/ into table1_copy
select * from table1;
commit;
In Oracle, A primary key cannot contain a NULL value.
But try the below..
Create table t1
(
col1 varchar2(30) null,
col2 varchar2(40),
add constraint col1_pk PRIMARY KEY ( col1 )
);
--The above is created successfully
TRICK
To copy a large table , use Oracle hint APPEND with Insert statement as below.
Consider the table TABLE1 having huge set of records ( > 10M rows )..
Create table TABLE1_copy
as
Select *
from TABLE1
where 1=2;
Insert /*+append*/ into table1_copy
select * from table1;
commit;
Comments