Supplement to the HP Neoview SQL Reference Manual (R2.3 SP2)

--- 1 row(s) inserted.
>>insert into t values (null);
*** ERROR[8102] The operation is prevented by a unique constraint.
--- 0 row(s) inserted.
Examples for Selecting Suitable Keys
These examples show the order by which Neoview SQL selects a suitable key based on the
precedence rules described in “How Neoview SQL Selects Suitable Keys” (page 9):
Selects column a as the primary and partitioning key:
Create volatile table t (a int);
Selects column b because int has a higher precedence than char:
Create volatile table t (a char(10), b int);
Selects column b because not null has precedence over nullable columns:
Create volatile table t (a int, b int not null);
Selects column b because int has precedence over decimal:
Create volatile table t (a decimal(10), b int);
Selects the first column, a, because both columns have the same data type:
Create volatile table t (a int not null, b int not null);
Selects column b because char has precedence over date:
Create volatile table t (a date, b char(10));
Selects column b because the real data type is not part of the columns to be looked at:
Create volatile table t (a real, b date);
Does not select any column as the primary/partitioning key. Instead, Neoview SQL selects
SYSKEY as the primary key and the table becomes a non-partitioned table:
Create volatile table t (a real, b double precision not null);
Similar examples would be used for CREATE TABLE AS SELECT queries.
Volatile Table Examples 11