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 difference between sql and mysql?
how to use case expression? : Sql dba
Explain the uses of control file.
what are different types of collation sensitivity? : Sql dba
Is id a reserved word in sql?
What is PL/SQL Records?
Is there a 64 bit version of ssms?
Where is sql database stored?
Can a key be both primary and foreign?
What is varchar data type in sql?
explain commit and rollback in mysql : sql dba
What are the various levels of constraints?
Explain how you can copy a file to file content and file to pl/sql table in advance pl/sql?
What is a sql profiler?
Define tables and fields in a database