data base access

new topic     » topic index » view thread      » older message » newer message

Rob, I think I have an understanding of the data base tools you have
provided and since you are working on 2.3 I would like to offer for your
consideration an approach with which I am familiar. You have suggested that
the 600+ data files I have should be organized into separate data bases by
module. (i.e AR, AP,IC,GL...etc.). Here's the issue. In a rather complex
program such as order entry we have 22 different files open at one time from
AR (customers), IC (part numbers from inventory), OP (orders), PU
(purchasing), SA (sales history of customer pricing) and on and on. This
program would span 4 or 5 data bases with the 22 tables. So not only would
we be switching tables but also data bases. Your concept of 'current data
base' and 'current table' would be useless here but fine for other programs
(i.e inventory maintenance or printouts).

If I have, in this order entry program, just read the customer record and
now need to read an inventory record here's what I would have to do
    1.  db_select (IC)
    2. db_select_table(ic_master)
    3. db_find_key(somePartkey)
    4. db_record_data(somePartRecordNbr)

This would be done over and over through the 22 tables, not a very direct
approach.  It would seem that the db's and tables' could be kept in a
sequence internally (built internally as the tables are opened) and the
reads could be done as follows

ic_record = db_read( db_opened_table[x], item_key) -- with one read and
items 1-4 be taken care of internally.
    if EOF [bb_opened_table[x]]                                         --
item not found, keeping the return code separate from the data read
        bla,bla
saves striping it out.
    end if

There could also be additional functions such as

ic_record = db_readnext(db_opened_table[x])     -- to provide the next
record in sorted order by keys. useful for reports and displays

ic_record = db_readprev(db_opened_table[x])     -- to provide the previous
record in sorted order by keys

db_add_record(db_opened_table[x], ic_record) -- adding to file

db_update_record(db_opened_table[x], somePartKey, somePartRecord)

db_delete_record(db_opened_table[x], somePartKey)

If db_opened_table[x] is "" then the functions would refer to the 'current
db and 'current table' such as

a read of    ic_record = db_readnext("")     --would refer to the 'current'
db and table.

This could actually be simplified by the old concept of file number that
would be returned by the open where we could just do:
    ic_record = db_read(x,somePartKey)    --where x would be used internally
to index into the db_opened_table[x]

I could probably write these functions but they would be better dealt with
internally in EU....I would say that the current functions you have should
remain in place so as not to break current programs being used.

I have probably not stated this properly in the flavor and syntax of EU but
hopefully you get the idea and can do something with it.
thanks...

...george

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu