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
Explain two easy sql optimizations.
what is error ora-03113: end-of-file on communication channel?
How to run sql statements through the web interface?
Why do we need view in sql?
What is flag in sql?
Is it possible to read/write files to-and-from PL/SQL?
How can you fetch common records from two tables?
how to present a past time in hours, minutes and seconds? : Sql dba
What are the types of operators available in sql?
What are %type and %rowtype for?
Enlist the characteristics of pl/sql?
What do you think about pl/sql?
How many sql commands are there?
discuss about myisam index statistics collection. : Sql dba
How would you reference column values before and after you have inserted and deleted triggers?