Can we use more than one null value for unique key?

Answer Posted / pratibha

u can insert multiple null values without ant error:

SQL> create table sab(name varchar2(10) unique);

Table created.

SQL> insert into sab values('&sab');
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> /
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> /
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> /
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> /
Enter value for sab:
old 1: insert into sab values('&sab')
new 1: insert into sab values('')

1 row created.

SQL> SQL> select count(*) from sab;

COUNT(*)
----------
5

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the largest value that can be stored in a byte data field?

710


Is sql a oracle?

698


How do you bind variables in pl sql?

761


what is a relationship and what are they? : Sql dba

749


what are the system privileges that are required by a schema owner (user) to create a trigger on a table?

811






What is the use of index in hive?

727


What are different types of indexes?

706


how many tables will create when we create table, what are they? : Sql dba

766


What are different types of sql commands?

698


What do you mean by table in sql?

696


Can you have more than one key in a database?

688


What is java sql connection?

693


Which is faster joins or subqueries?

717


Hi how to import oracle sequence in Informatica? Please write stored procedure code that will import oracle sequence in Informatica SP transformation as per below scenario Oracle table product list Pro_id, pro_name 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights Now a new flat file with new product list needs to be added to oracle table product list with oracle sequence. flat file product Prono,pro_name, 1, 20 watt tube light 2, 30 watt tube light & target should be like 101, LED Lights. 102, 20watt CFL Lights. 103, 30 watt CFL lights. 104, 20 watt tube light 105, 30 watt tube light thks reg suvarna joshi suvarnaatsuvarna@rediffmail.com

2259


What are the ways on commenting in a pl/sql code?

676