SQL/MX Programming Manual for C and COBOL (G06.24+, H06.03+)
C Sample Programs
HP NonStop SQL/MX Programming Manual for C and COBOL—523627-004
A-28
Using SQL Descriptors to Select KANJI and
KSC5601 Data
Using SQL Descriptors to Select KANJI and
KSC5601 Data
DDL for KANJI and KSC4501 Table Columns
Example A-9 creates SQL/MP tables that contain KANJI and KSC4501 columns and
inserts data into those columns.
Example A-9. DDL for KANJI and KSC4501 Table Columns (page1of2)
CREATE TABLE words( wordInKanji char(20) CHARACTER SET KANJI,
wordInKsc5601 char(20) CHARACTER SET KSC5601); -- An
SQL/MP
table
INSERT INTO words VALUES (_kanji'Japan ', _ksc5601'Japan ');
INSERT INTO words VALUES (_kanji'Korea ', _ksc5601'Korea ');
DROP TABLE international_customer;
CREATE TABLE international_customer (
custnum numeric(4) unsigned
no default not NULL not droppable,
custname CHARACTER(18) CHARACTER SET UCS2
no default not NULL not droppable,
street CHARACTER(22) CHARACTER SET UCS2
no default not NULL not droppable,
city CHARACTER(14) CHARACTER SET UCS2
no default not NULL not droppable,
country CHARACTER(20) CHARACTER SET UCS2
no default not NULL not droppable,
postcode CHARACTER(10)
no default not NULL not droppable,
primary key (custnum) not droppable
);
INSERT INTO international_customer VALUES
(1,
_UCS2'John Smith',
_UCS2'102 Main Street',
_UCS2'Toyko',
_UCS2'Japan',
'56789'
),
(2,
_UCS2'John Smith',
_UCS2'102 Jefferson Street',
_UCS2'Shanghai',
_UCS2'China',
'23189'
),