SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

MXCI Commands
HP NonStop SQL/MX Reference Manual523725-004
4-72
Examples of SHOWDDL
, CONSTRAINT CAT.SCH.T1_102261179_0003 CHECK
(CAT.SCH.T1.N IS NOT NULL AND
CAT.SCH.T1.C IS NOT NULL) NOT DROPPABLE
)
LOCATION \FIGARO.$DATA1.ZSDQXXBK.B7VVVW00
NAME FIGARO_DATA1_ZSDQXXBK_B7VVVW00
ATTRIBUTES MAXEXTENTS 600
STORE BY (C DESC, N ASC)
;
-- The following index is a system created index --
CREATE UNIQUE INDEX T1_102261179_0004 ON CAT.SCH.T1
(
C ASC
)
LOCATION \FIGARO.$DATA2.ZSDUXXBK.B7VVVW00
NAME FIGARO_DATA2_ZSDQXXBK_B7VVVW00
ATTRIBUTES MAXEXTENTS 600
;
-- The following index is a system created index --
--CREATE UNIQUE INDEX PK ON CAT.SCH.T1
-- (
-- N ASC
-- )
-- LOCATION \FIGARO.$DATA1.ZSDXXXBK.B7VVVW00
-- NAME FIGARO_DATA1_ZSDQXXBK_B7VVVW00
-- ATTRIBUTES MAXEXTENTS 600
-- ;
ALTER TABLE CAT.SCH.T1
ADD CONSTRAINT CAT.SCH.T1_102261179_0004 UNIQUE
(C) DROPPABLE;
Note how the unique constraint is moved out of the CREATE TABLE statement and
into an ALTER TABLE statement, how the index supporting the unique constraint
precedes the creation of the unique constraint, and how the index supporting the
not droppable primary key is commented out because a system created index
would be implicitly created.
These are examples of SHOWDDL on tables with partitions that are offline. Note
the commenting out of partitions that are offline, and the whole partition clause if all
the partitions are offline.
>>SHOWDDL T1;
CREATE TABLE CAT.SCH.T1
(
A INT DEFAULT NULL
, B INT NO DEFAULT -- NOT NULL NOT DROPPABLE
, C INT NO DEFAULT -- NOT NULL NOT DROPPABLE
, CONSTRAINT CAT.SCH.T1_104871912_0091
PRIMARY KEY (B ASC, C DESC) NOT DROPPABLE
, CONSTRAINT CAT.SCH.T1_104871912_0090 CHECK
(CAT.SCH.T1.B IS NOT NULL AND
CAT.SCH.T1.C IS NOT NULL) NOT DROPPABLE
)
LOCATION \FIGARO.$DATA.ZSDADM53.VZBRLI00