Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: primary key & nlssort

Re: primary key & nlssort

From: <stvchien0_at_gmail.com>
Date: Sat, 30 Jun 2007 08:23:34 +0800
Message-ID: <598b83lj41dtjrm8uou1tlld1amj3pqb72@4ax.com>


On Fri, 29 Jun 2007 14:00:00 -0700, DA Morgan <damorgan_at_psoug.org> wrote:

>stvchien0_at_gmail.com wrote:
>> Hi,
>>
>> Since Oracel will create indexe for PRIMARY KEY constraint, can we
>> use the NLSSORT with the column(s) which is(are) part of the PRIMARY
>> KEY?
>>
>> Thanks!
>>
>> - STeve
>
>What version and please rewrite your inquiry and better describe what
>you are asking. An example might be helpful.

Hi,

  We're using Oracle 10g Release 2. Here is the example,

CREATE TABLE MYTEST
(ID NUMBER(5,0) NOT NULL,
 TYPE VARCHAR2(16) NOT NULL,
 MSG VARCHAR2(1024) NOT NULL); CREATE UNIQUE INDEX PK_MYTEST ON MYTEST(ID, NLSSORT(TYPE, 'NLS_SORT=BINARY_CI')); ALTER TABLE MYTEST ADD CONSTRAINT PK_MYTEST PRIMARY KEY(ID, TYPE);   We got 'ORA-00955: name is already used by an existing object' error.

  The other case didn't work either.

CREATE TABLE MYTEST
(ID NUMBER(5,0) NOT NULL,
 TYPE VARCHAR2(16) NOT NULL,
 MSG VARCHAR2(1024) NOT NULL); alter table mytest add constraint PK_mytest primary key(ID, NLSSORT(TYPE, 'NLS_SORT=BINARY_CI'));   We got 'ORA-00904: : invalid identifier' error.

  Hopefully, this example could show what we would like to achieve. Thanks!

Received on Fri Jun 29 2007 - 19:23:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US