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
Why we use pl sql?
Define tables and fields in a database
What is the difference between count 1 and count (*) in a sql query?
how to shutdown mysql server? : Sql dba
which command using query analyzer will give you the version of sql server and operating system? : Sql dba
What is difference between left and right outer join?
How do I debug a stored procedure?
What type of database is sql?
How can we link a sql database to an existing android app?
How can I change database name in sql?
What is sql*plus?
How do I sort a table in sql?
how to convert character strings to numeric values? : Sql dba
How to move files from one directory to another in pl sql?
How do you update f as m and m as f from the below table testtable?