I have a table in which I need both the values to be primary because I am referencing this combination as foreign key in the other tables. Table definition and the data I need to put are as follows
create table T1
(
sno number(10),
desc varchar2(10),
constraint T1_PK primary key(sno,desc)
)
DATA to put
sno | desc
---------------------------
100 | "hundred"
000 | null
120 | "one twenty"
123 | "" <EMPTY STRING>
000 | "" <EMPTY STRING>
Problem here is desc can be sometimes be null. Primary key can not be null so when I encounter a null value - I'm inserting simply "" in the table. The problem here is some times desc may have empty string. If I insert the about data 100,Null and 100,"" are two different things but I am not able to put them in the table. I don't want to put some string like 'EMPTY' if null because it may confuse the end user who is looking at the table.
1) How can I handle the null case for desc, while having it as a primary key. I can not use Auto sequence number. 2) How can I distinguish between null string introduced by me and one that is already there?