Re: primary key

Re: primary key

 

  

Agree!!!

KAzi

???????? ??????? wrote:

>Wow! Cool! Respect!
>
>Best Regards, Dmitry Kulitskiy [AM-Soft, Kiev, Ukraine]
>
>
>
>>-----Original Message-----
>>From: Amar Kumar Padhi
>>
>>
>>
>[mailto:oracledba-ezmlmshield-x17533857.[Email Address Removed]
>
>
>>Sent: Wednesday, April 06, 2005 4:45 PM
>>To: LazyDBA Discussion
>>Subject: RE: primary key
>>
>>Yes you can! In a way you can fool it.
>>
>>SQL> create table am472 (col1 number, col2 varchar2(100));
>>
>>Table created.
>>
>>SQL> insert into am472 values(1, 'test');
>>
>>1 row created.
>>
>>SQL> insert into am472 values(1, 'test');
>>
>>1 row created.
>>
>>SQL> insert into am472 values(2, 'test');
>>
>>1 row created.
>>
>>SQL> commit;
>>
>>Commit complete.
>>
>>SQL> create index am472_ind on am472(col1);
>>
>>Index created.
>>
>>SQL> alter table am472 modify col1 primary key novalidate;
>>
>>Table altered.
>>
>>SQL> insert into am472 values(1, 'test');
>>insert into am472 values(1, 'test')
>>*
>>ERROR at line 1:
>>ORA-00001: unique constraint (RAPID.SYS_C0079629) violated
>>
>>
>>So the table now has primary key and will check for new
>>values only, existing duplicate values exist...
>>
>>SQL> select constraint_name, constraint_type
>> 2 from dba_constraints
>> 3 where table_name = 'AM472';
>>
>>CONSTRAINT_NAME C
>>------------------------------ -
>>SYS_C0079629 P
>>
>>SQL> select * from am472;
>>
>> COL1 COL2
>>---------- --------------------
>> 1 test
>> 1 test
>> 2 test
>>
>>Thanks!
>>amar kumar padhi
>>Service Delivery, RAPID
>>
>>
>>-----Original Message-----
>>From: Ant¨Žnio Pedro Lemos dos Santos
>>[mailto:oracledba-ezmlmshield-x68688404.[Email address
>>
>>
>protected]
>
>
>>Sent: 06 April 2005 17:12
>>To: LazyDBA Discussion
>>Subject: Re: primary key
>>
>>
>>Allways unique.
>>You can't do it.
>> ----- Original Message -----
>> From: Zelli Brian
>> To: LazyDBA Discussion
>> Sent: Wednesday, April 06, 2005 2:04 PM
>> Subject: primary key
>>
>>
>> Ok, a stupid question. We are having a debate whether
>>
>>
>you
>
>
>>can create a
>>primary key that is non-unique. Logic aside, is it
>>
>>
>possible
>
>
>>in oracle? Can
>>you syntactically do it or can't you?
>>
>> ciao,
>> Brian
>>
>>
>> --------
>> website: http://www.LazyDBA.com
>> Please don't reply to RTFM questions
>> Oracle documentation is here: http://tahiti.oracle.com
>> To unsubscribe: see
>>
>>
>http://www.lazydba.com/unsubscribe.html
>
>
>> To subscribe: see http://www.lazydba.com
>> By using this list you agree to these
>>terms:http://www.lazydba.com/legal.html
>>
>>
>>--------
>>website: http://www.LazyDBA.com
>>Please don't reply to RTFM questions
>>Oracle documentation is here: http://tahiti.oracle.com
>>To unsubscribe: see
>>
>>
>http://www.lazydba.com/unsubscribe.html
>
>
>>To subscribe: see http://www.lazydba.com
>>By using this list you agree to these
>>terms:http://www.lazydba.com/legal.html
>>
>>
>>--------
>>website: http://www.LazyDBA.com
>>Please don't reply to RTFM questions
>>Oracle documentation is here: http://tahiti.oracle.com
>>To unsubscribe: see
>>
>>
>http://www.lazydba.com/unsubscribe.html
>
>
>>To subscribe: see http://www.lazydba.com
>>By using this list you agree to these
>>terms:http://www.lazydba.com/legal.html
>>
>>
>>
>>
>
>
>
>--------
>website: http://www.LazyDBA.com
>Please don't reply to RTFM questions
>Oracle documentation is here: http://tahiti.oracle.com
>To unsubscribe: see http://www.lazydba.com/unsubscribe.html
>To subscribe: see http://www.lazydba.com
>By using this list you agree to these terms:http://www.lazydba.com/legal.html
>
>
>
>
>

Oracle LazyDBA home page