select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_U2';
alter table userinfo_u2 disable constraint un_username_new;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_U2';
alter table userinfo_u2 disable constraint un_username_new;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_U2';
2018-01-09
create table userinfo_u2(id varchar2(10) primary key,username varchar2(20));
alter table userinfo_u2 add constraint un_username_new unique(username);
alter table userinfo_u2 add constraint un_username_new unique(username);
2018-01-09
create table userinfo_u(id varchar2(10) primary key,username varchar2(20) unique,userpwd varchar2(20));
create table userinfo_u1(id varchar2(10) primary key,username varchar(20),userpwd varchar2(20) ,constrait un_username unique(username));
create table userinfo_u1(id varchar2(10) primary key,username varchar(20),userpwd varchar2(20) ,constrait un_username unique(username));
2018-01-09
alter table userinfo_f4 drop constraint fk_typeid_alter;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_F4';
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_F4';
2018-01-09
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_F4';
alter table userinfo_f4 fisable constraint fk_typeid_alter;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_F4';
alter table userinfo_f4 fisable constraint fk_typeid_alter;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_F4';
2018-01-09
create table userinfo_f4(id varchar2(10) primary key,username varchar2(20),typeid_new varchar2(10));
alter table userinfo_f4 add constraint fk_typeid_alter foreign key(typeid_new) references typeinfo(typeid);
alter table userinfo_f4 add constraint fk_typeid_alter foreign key(typeid_new) references typeinfo(typeid);
2018-01-09
create table userinfo_f3(id varchar2(10) primary key,username varchar2(20),typeid_new varchar2(10),constraint fk_typeid_new1 freign key(typeid_new) references typeinfo(typeid) on delete cascade);
2018-01-09
create table userinfo_f2(id varchar2(10) primary key,username varchar2(20),typeid_new varchar2(10),constraint fk_typeid_new freign key(typeid_new) references typeinfo(typeid));
2018-01-09
insert into typeinfo values(1,1);
insert into userinfo_f(id,typeid_new) values(1,2);
insert into userinfo_f(id,typeid_new) values(1,1);
insert into userinfo_f(id,typeid_new) values(1,null);
insert into userinfo_f(id,typeid_new) values(1,2);
insert into userinfo_f(id,typeid_new) values(1,1);
insert into userinfo_f(id,typeid_new) values(1,null);
2018-01-09
create table typeinfo(tyoeid varchar2(10) primary key,typename varchar2(20));
create table userinfo_f(id varchar2(20) primary key,username varchar2(20),typeid_new varchar2(10) references typeinfo(typeid));
create table userinfo_f(id varchar2(20) primary key,username varchar2(20),typeid_new varchar2(10) references typeinfo(typeid));
2018-01-09
select constraint_name,tatus from user_constraints where table_name='USERINFO';
alter table userinfo_p drop primary key;
desc userinfo_p
alter table userinfo_p drop primary key;
desc userinfo_p
2018-01-08
select constraint_name from user_constraints where table_name='USERINFO';
alter table userinfo disable constraint new_pk_id;
select constraint_name,tatus from user_constraints where table_name='USERINFO';
alter table userinfo drop constraint new_pk_id;
alter table userinfo disable constraint new_pk_id;
select constraint_name,tatus from user_constraints where table_name='USERINFO';
alter table userinfo drop constraint new_pk_id;
2018-01-08
desc userinfo
alter table userinfo add constraint pk_id primary key(id);
desc user_constraint
select constraint_name from user_constraints where table_name='USERINFO';
alter table userinfo rename constraint pk_id to new_pk_id;
alter table userinfo add constraint pk_id primary key(id);
desc user_constraint
select constraint_name from user_constraints where table_name='USERINFO';
alter table userinfo rename constraint pk_id to new_pk_id;
2018-01-08