Sub Keys are NOT unique


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Jim Guerber on October 23, 2005 at 09:36:54:

This is really a continuation of the thread indicated below.

Steve... you are totally correct.... Sub keys are NOT unique. When you specify a key on a read of a sub key, you will get back the FIRST record matching that sub key. When you then perform sequential reads, you will get back the next records which may or may not contain the same sub-key.

As Steve said, it is more like SQL than our old keyed file approach. BUT.. it is even better in that sequential reads will give back records in sub-key order even beyond the sub-key requested.

The following piece of code illustrates this technique.


record: format fname$;lname$.....
print 'enter the first name'
input InName$
close(1) & open(1)'file' key='fname'
position(1) key=InName$
do
read(1,record) excp=done
if fname$ ne InName$ goto done
.
.
.
loop
done:


Notice that there is no keyed read at all, just a position.


Steve is also correct about the primary key. It almost does not matter. It could be merely a sequential number used in order to keep all records unique. Some data bases use this technique.

BTW, elsewhere Grant suggested we order sub keys in primary key order. Since keys can be as long as 254 bytes, we felt that this would make the Ixx files unnecessarily large.



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):






[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]