manoghna Posted February 16, 2011 Report Posted February 16, 2011 this is for taking NULL value by defaultALTER TABLE (table name)ADD CONSTRAINT (give some name like metadata_store_default)DEFAULT NULL FOR metadata_storeGO_________________________________________________________________________and a 3values kosam use thisALTER TABLE (table name)ADD CONSTRAINT (constarint name like cc_metasata_store what ever u like )CHECK (metadata_store IN ('ETA', 'ETA_LEGACY', 'AIDW'));hope it will work sSa_j@il sSa_j@il
pillabachapk Posted February 16, 2011 Report Posted February 16, 2011 [quote author=Nemo link=topic=156607.msg1857598#msg1857598 date=1297894020]trying baa...doubt vaste wil ask u sHa_fr1ends[/quote]aa constraint last lo IS NULL condition include chesi chudu....sHa_fr1ends
bongule Posted February 16, 2011 Author Report Posted February 16, 2011 [quote author=manoghna link=topic=156607.msg1857569#msg1857569 date=1297893622] sCo_hmmthink sCo_hmmthink sCo_hmmthinkso a 3 values kakapothe null value tesukovala a column?ithe default constraint with null kooda add cheyalemo a cloumn ki let me check...[/quote][quote author=Pilloduuuuuu link=topic=156607.msg1857571#msg1857571 date=1297893659]nemo oka solution cheptaa....i donno whether it will work first aa column create cheyiii....tarvata alter table script raayi...NULL allow chestuuu[/quote]no worries...nenu not null ani pettakunda...constraint lo 3 values icha..its taking null as well as these 3 values only..so ee question tho no problem
bongule Posted February 16, 2011 Author Report Posted February 16, 2011 ee simple trigger ee pani cheyyatledhu baa endukocreate trigger id_triggerbefore insert on ITEM_TYPESfor each rowbeginselect id_seq.nextval into :new.id from dual;end;
pillabachapk Posted February 16, 2011 Report Posted February 16, 2011 [quote author=manoghna link=topic=156607.msg1857615#msg1857615 date=1297894295]this is for taking NULL value by defaultALTER TABLE (table name)ADD CONSTRAINT (give some name like metadata_store_default)DEFAULT NULL FOR metadata_storeGO_________________________________________________________________________and a 3values kosam use thisALTER TABLE (table name)ADD CONSTRAINT (constarint name like cc_metasata_store what ever u like )CHECK (metadata_store IN ('ETA', 'ETA_LEGACY', 'AIDW'));hope it will work sSa_j@il sSa_j@il[/quote]nenu anukunnadi ide....using alter table...
bongule Posted February 16, 2011 Author Report Posted February 16, 2011 [quote author=Pilloduuuuuu link=topic=156607.msg1857624#msg1857624 date=1297894373]nenu anukunnadi ide....using alter table...[/quote]this is working fine baacreate table ITEM_TYPES( id number(5),short_name varchar2(4) ,name varchar2(20) ,description varchar2(200) not null,contains_images varchar2(1) not null,metadata_store varchar2(15),deprecation_date date,decommission_date date,CONSTRAINT cc_metasata_store CHECK (metadata_store IN ('ETA', 'ETA_LEGACY', 'AIDW')),primary key(id,short_name,name));
htnamus Posted February 16, 2011 Report Posted February 16, 2011 [quote author=Nemo link=topic=156607.msg1857627#msg1857627 date=1297894429]this is working fine baacreate table ITEM_TYPES( id number(5),short_name varchar2(4) ,name varchar2(20) ,description varchar2(200) not null,contains_images varchar2(1) not null,metadata_store varchar2(15),deprecation_date date,decommission_date date,CONSTRAINT cc_metasata_store CHECK (metadata_store IN ('ETA', 'ETA_LEGACY', 'AIDW')),primary key(id,short_name,name));[/quote]hammayyaaaaa ipatiki aachhinda ..ushhhhh
Ranga_The_Donga Posted February 16, 2011 Report Posted February 16, 2011 [quote author=Nemo link=topic=156607.msg1857627#msg1857627 date=1297894429]this is working fine baacreate table ITEM_TYPES( id number(5),short_name varchar2(4) ,name varchar2(20) ,description varchar2(200) not null,contains_images varchar2(1) not null,metadata_store varchar2(15),deprecation_date date,decommission_date date,CONSTRAINT cc_metasata_store CHECK (metadata_store IN ('ETA', 'ETA_LEGACY', 'AIDW')),primary key(id,short_name,name));[/quote] ^^" ^^" ^^" ^^" ^^"
manoghna Posted February 16, 2011 Report Posted February 16, 2011 [quote author=Pilloduuuuuu link=topic=156607.msg1857624#msg1857624 date=1297894373]nenu anukunnadi ide....using alter table...[/quote]avuna ok.... sHa_high5ing sHa_high5ing
pillabachapk Posted February 16, 2011 Report Posted February 16, 2011 [quote author=Nemo link=topic=156607.msg1857622#msg1857622 date=1297894361]ee simple trigger ee pani cheyyatledhu baa endukocreate trigger id_triggerbefore insert on ITEM_TYPESfor each rowbeginselect id_seq.nextval into :new.id from dual;end;[/quote]error emani vastundii
Recommended Posts