SQL/MX Queuing and Publish/Subscribe Services
HP NonStop SQL/MX Queuing and Publish/Subscribe Services—523734-002
A-1
A The Shipping Database
The examples presented in this appendix use tables created by the execution of 
SQL/MX CREATE TABLE statements. For further information about this statement, see 
the SQL/MX Reference Manual.
The SQL/MX DDL and SQL/MX INSERT statements provided in this appendix enable 
you to create and populate the queueing and publish/subscribe database so that you 
can use the SQL/MX features described in this manual. 
CREATE CATALOG PSDB;
CREATE SCHEMA PSDB.PUBS;
CREATE TABLE psdb.pubs.inbox
 (
 destination INT NOT NULL,
 origin INT NOT NULL,
 seqnbr INT DEFAULT 0 NOT NULL,
 priority INT,
 archive CHAR(1) DEFAULT 'N',
 abortcount INT DEFAULT 0 NOT NULL,
 PRIMARY KEY (destination, origin, seqnbr)
 )
PARTITION
(
 ADD FIRST KEY 230 LOCATION $PART1VOL,
 ADD FIRST KEY 260 LOCATION $PART2VOL
)
;
CREATE INDEX iinbox ON psdb.pubs.inbox (priority);
CREATE TABLE psdb.pubs.routes
 (origin INT NOT NULL,
 destination INT NOT NULL,
 hub INT,
 PRIMARY KEY (origin, destination)
 );
CREATE TABLE psdb.pubs.channel
 (destination INT,
 origin INT,
 priority INT);
CREATE INDEX ichannel ON psdb.pubs.channel (priority);
-------------------------------------------------------------
-- Note: Abortcount is required for rollback example,
-- Archive flag is required for embedded update example
-------------------------------------------------------------
-------------------------------------------------------------
-- The following script is to be run in MXCI:
-------------------------------------------------------------










