Can we use more than one null value for unique key?
Answer Posted / sabariesh thavamani
i worked out the coding in the above using oracle 9 i, but
i could not get the correct answer what he told.. try it
SQL> create table sab(name varchar2(10) unique);
Table created.
SQL> insert into sab values('&sab');
Enter value for sab: null
old 1: insert into sab values('&sab')
new 1: insert into sab values('null')
1 row created.
SQL> /
Enter value for sab: null
old 1: insert into sab values('&sab')
new 1: insert into sab values('null')
insert into sab values('null')
*
ERROR at line 1:
ORA-00001: unique constraint (LPUSER18.SYS_C0038068)
violated
SQL> /
Enter value for sab: sabari
old 1: insert into sab values('&sab')
new 1: insert into sab values('sabari')
1 row created.
SQL> /
Enter value for sab: null
old 1: insert into sab values('&sab')
new 1: insert into sab values('null')
insert into sab values('null')
*
ERROR at line 1:
ORA-00001: unique constraint (LPUSER18.SYS_C0038068)
violated
SQL> select * from sab
2 ;
NAME
----------
null
sabari
try it....
| Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
What is error ora-12154: tns:could not resolve the connect identifier specified?
What is cold data?
Who is the owner of mysql database?
What is the difference between the implicit and explicit cursors?
How global cursor can be declare with dynamic trigger ?
How does one load ebcdic data? : aql loader
Does a user_objects view have an entry for a trigger?
How many tables can a sql database have?
How much does sql certification cost?
Do prepared statements prevent sql injection?
Explain the savepoint statement.
how to use case expression? : Sql dba
How do you rank data in sql?
How do I clear the screen in sql plus?
What are the different types of dbmss?