[comp.lang.icon] Icon Database

tenaglia@mis.mcw.edu ("Chris Tenaglia - 257-8765") (10/03/90)

Concerning Icon Databases :

I wrote one. It's not relational. The initial version held the data in a list.
The records had fixed size fields delimited with \377 (X'FF'). Later I stored
the data in a table of lists where the database key formed the 'entry' and
entire lines (\377 delimited) in a list as the 'assignment'. A database would
actually occupy 2 files. The data file and a description file. Here's a sample
of a description file (PB.ATCP).

data in pb.dat
header is ABBREVIATED PHONEBOOK DATABASE &DATE
fields are First_Name Last__Name Ext/Flag__ Department Main_Phone Information 
lengths are 10 10 4 20 12 20 
look up 2
sort on 2
print using 1 57 lpa0 n/a
title begin
< <    PERSONAL VENDOR/DEPARTMENTAL TELEPHONE DATABASE > >
TODAY IS &DATE                                        &PAGE
NAME                    E/F   DEPARTMENT            PHONE         INFORMATION
======================  ====  ====================  ========      ===========
title end

One invokes the database using the description file. 'data in' tells which file
the data is in. 'header is' puts a header on all the screens to remind one what
database is active. 'fields are' describes the field names as they would appear
on the screen. 'lengths are' describes the number of bytes in each field. Space
characters delimit the tokens, and the 'fields are' and 'lengths are' must have
the same amount of tokens. 'look up' defines the look up key, which is one or
for fields referenced by position from 1 to ???.'sort on' specified the default
order for purposes of printing or viewing. 'print using' indicated the spacing,
1=single 2=double, lines per page, default printer queue, and whether to print
all as a solid block (n/a), skip a line when the 'lookup' field changed (skip),
or to eject a page when the the 'lookup' field(s) changed. 'title begin' and
'title end' describe the print out title for every page. &DATE generates todays
date on the screen header or print title. &PAGE in the print title generates
the page # while printing the report.

The database capacity and performance may be an issue. The list based version
was very slow with lookups and deletes. The table version is real slow on the
print version, as it sorts the data before printing. I never measured it's
maximum limit. It seems useful upto 1000 items. One can change to a different
database or data file on the fly, insert or delete columns, change the lookup
key, alter the default settings. I actually use it for some useful things.
But it's not relational. I think of it as a data 'editor' and report writer.

Chris Tenaglia (System Manager)
Medical College of Wisconsin
8701 W. Watertown Plank Rd.
Milwaukee, WI 53226
(414)257-8765
tenaglia@mis.mcw.edu, mcwmis!tenaglia