Legacy record formats in DB2/SQL

A co-worker pointed out an interesting clause in the DB2 CREATE TABLE and CREATE INDEX statements. If you’re like us and trying to integrate some DB2/SQL with your legacy S/3x applications, you may have run into a case where you need to differentiate between your table name and the record format on input. For newer tables, instead of resorting to the RENAME keyword, you can specify a record format name in your SQL CREATE statement. Just use:

CREATE TABLE QTEMP/TESTFILE (
COLUMN_1 CHARACTER (1 ) NOT NULL WITH DEFAULT)
RCDFMT TESTFMT

This will create the table TESTFILE with a record format of TESTFMT, making integration with your legacy applications a little more straightforward.

Comments are closed.