Entries in create (1)

Tuesday
Jul292008

Creating tabfiles, tables and indexes in DBMS

We wanted to use a tabfile to keep a track of all our updates. So every update retreival or schema modify has a call to a member which updates a tabfile with details of the update, the retrieval etc and does a couple of checks to make sure we havent missed out an update level

Step One Create tabfile,

DROP TABFILE UPDATES
CREATE TABFILE UPDATES
FILENAME 'G:/DB/DATABASES/UPDATES/UPDATES.TBF'

Step Two Create tables and indexes

CREATE TABLE UPDATES.NCDS (UPDLEV INT, UPDDATE DATE ('DDMMMYY'), UPDID STRING (20) COMMENT STRING (140))
CREATE UNIQUE INDEX UPDLEVDESC ON UPDATES.NCDS (UPDLEV DESC)

This does not currently work (and should be fixed soon) a workaround (thanks to David Baxter for this) is:

PROGRAM
INTEGER UPDLEV
DATE UPDDATE ('DDMMMYY')
STRING*20 UPDID
STRING*140 COMMENT
PERFORM PROCS
SAVE TABLE UPDATES.NCDS REPLACE BOOLEAN (0)
END PROGRAM

CREATE UNIQUE INDEX UPDLEVDESC ON UPDATES.NCDS (UPDLEV DESC)