How can I set a column to be an "" (the empty string, equivalent to NULL in Oracle), when that column is part of a multiple-column primary key? This is the motivation...
CREATE TABLE entities (
column1 VARCHAR2(10)
, column2 VARCHAR2(10)
, body VARCHAR2(4000)
, CONSTRAINT pk_entities -- can't do this, because sometimes
PRIMARY KEY ( column1, column2 ) -- col2 is the empty string (NULL).
) ORGANIZATION INDEX ...
Normally, I'd use a "real" primary key like a meaningless sequential id (see this question) and then put a unique constraint over my data columns, like so...
CREATE TABLE entities (
, id NUMBER PRIMARY KEY
, column1 VARCHAR2(10)
, column2 VARCHAR2(10)
, body VARCHAR2(4000)
, CONSTRAINT unq_entities
UNIQUE ( column1, column2 )
) ORGANIZATION INDEX ...
However, this is a big index-organized table (IOT), so the primary key has to be on the data columns (in IOTs, the data is the index) or else... What should I do?
Thanks! ♥