« Adding a row to a tabfile table | Main | SIR coding blog setup »
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)

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>