Case In-Sensitive primary key (NVARCHAR2 datatype) in Oracle

Case In-Sensitive primary key (NVARCHAR2 datatype) in Oracle

Postby rranjan325 » Fri 31 Jul 2009 13:48

I have primary keys in my database which are of NVARCHAR2 type. By default data is inserted into these columns as case sensitive which means insertion of both 'ABCD' and 'Abcd' are allowed.

Can I change the settings in Oracle so that the primary keys work case in-sensitively? I wanted Oracle to throw an error if someone is inserting 'Abcd' and if there is already a record with primary key 'ABCD'.

Note: I am using Entity Framework.
rranjan325
 
Posts: 4
Joined: Mon 06 Jul 2009 10:33

Postby AndreyR » Tue 04 Aug 2009 13:39

Justin and Mark replied to your question here:
http://forums.oracle.com/forums/thread. ... dID=937377
As they said, you have two alternatives - either to create unique case-insensitive constaint on the primary key column,
or to create an insert trigger that will compare the new primary key value cast to upper case with all values of the
primary key column also cast to upper case.
Anyway, this constraint is to be implemented on the server side.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle