ODBC Server Reference Manual

Creating Partitioned Tables
HP NonStop ODBC Server Reference Manual429151-002
F-3
Example CREATE TABLE Statement
Example CREATE TABLE Statement
Execute the following CREATE TABLE statement from an ODBC client that is
connected to ODBC service configured to use the previous example template.
CREATE TABLE db1.sql_odbc. T1 (C1 int, C2 char(5),
C3 char(5),
PRIMARY KEY (C1,C3))
If TRACE is on, you can see the CREATE TABLE translated into the following SQL/MP
statement:
CREATE TABLE \N1.$ODBC.SV1.T1
( C1 INT NOT NULL HEADING “C1”
, C2 CHAR(5) NOT NULL HEADING “C2”
, C3 CHAR(5) NOT NULL HEADING “C3”
,PRIMARY KEY (C1,C3) )
PARTITION ( \N1.$VOLUME1.SV1.T1 EXTENT 64 MAXEXTENTS 160
FIRST KEY -1000
,\N1.$VOLUME.SV1.T1 EXTENT 32 MAXEXTENTS 128
FIRST KEY 1000
,\N1.$VOLUME.SV1.T1 EXTENT 64 MAXEXTENTS 160
FIRST KEY 2222)
;
The partition specification for primary key C1 is used as the best subset match
between the original CREATE. . .PRIMARY KEY and the templates.
The subvolume and filename are used to modify the partition specification template
according to SQL/MP syntax.