You can save DBCS data in your database if you define the columns in which you save the data as character or graphic. Whether you save your DBCS data in character or graphic columns depends on your needs:
Specifically, QMF can save DBCS data in database columns that are defined as these data types:
In DB2, variable character data can exceed 126 characters. When variable character data exceeds 126 characters, it is handled like the LONG VARCHAR data type.
In DB2 QMF Version 8.1, LOB data types CLOB, DBCLOB, and BLOB can now be displayed in a QMF report without having to be casted as VARCHAR or VARGRAPHIC data types. The size of a LOB data row ranges from 0 bytes to 2 GB minus one byte.
Because of the potential size of LOB data, users may want to limit the viewing of actual data within a report. Instead of displaying the actual LOB data by default, the LOB DA, consisting of the LOB data type name and defined length of the LOB data, will be displayed. The LOB DA is specified through the setting of edit code 'M' (new in QMF Version 8.1) on every LOB column by default. See Specifying punctuation for the values in a column
The following EXEC SQL statements are necessary in order to determine the potential number of host variables required to deal with large LOB (greater than 32 KB up to 2 GB).
EXEC SQL DECLARE C1 CURSOR FOR 'SELECT LENGTH(CLOB_COL) FROM LOB_TABLE'
EXEC SQL OPEN CI
EXEC SQL WHENEVER NOT FOUND CONTINUE
EXEC SQL FETCH CI TO :LOB_ALEN
The result of these statements will be a one-column result table with each row containing a 4 byte length. Each length will be set into the field LOB_DLEN for the particular LOB record.
A minimimum of five data definition language (DDL) SQL queries must be issued for each request to create a LOB table. For n number of LOB columns, 2 + 3n CREATE statement queries are required. LOB tables will not function if any part of the definition is missing. Here are five required steps to create a complete definition for a LOB table:
CREATE TABLE LOB (COLCHAR(8), CLOB CLOB(4K), BLOB BLOB(4K), ID ROWID NOT NULL GENERATED BY DEFAULT) IN DSQDBDEF.DSQTSDEFTables with LOB columns must also have a ROWID column. The LOB length can be up to 2 GB.
CREATE TYPE 2 UNIQUE INDEX MCOATES.LOBID ON MCOATES.LOB(ID)
CREATE LOB TABLESPACE LOBTB IN DSQDBDEF LOCKSIZE LOB USING STOGROUP DSQSGDEF PRIQTY 1 SECQTY 0 BUFFERPOOL BP0 CLOSE NO CREATE LOB TABLESPACE LOBTB2 IN DSQDBDEF LOCKSIZE LOB USING STOGROUP DSQSGDEF PRIQTY 1 SECQTY 0 BUFFERPOOL BP0 CLOSE NO
CREATE AUX TABLE MCOATES.AXCLOB IN DSQDBDEF.LOBTB STORES MCOATES.LOB COLUMN CLOB CREATE AUX TABLE MCOATES.AXBLOB IN DSQDBDEF.LOBTB2 STORES MCOATES.LOB COLUMN BLOB
CREATE INDEX MCOATES.AXCLOBX ON MCOATES.AXCLOB CREATE INDEX MCOATES.AXBLOBX ON MCOATES.AXBLOBTable-name, database-name, and table-space-name are required host variable parameters.