Robert...EDS - questions/comments
- Posted by Jonas Temple <jktemple at yhti.net> Feb 12, 2001
- 504 views
Robert, I have some questions/comments concerning the EDS: 1. Say I have a table with a key structure of : {atom, atom}. I insert 3 records with the following key values: {1 , 1} {1, 2} {1, 3}. I add another 10,00 entries with other key values. I then add {1, 4} {1, 5}. Now I want to get all records with the first key value of 1. Assuming I use db_find_key and find and read the first three records, would I have to read through the next 10,000 to get the last two records? If I checked for the first key value to change and then drop out of my read loop I would think I would miss the last two records for key value of 1. Is this right? If so, would it be possible to add a function to "retrieve_next_record_by_partial_key"? I suppose I could increment the second key value by 1 and use db_find_key but what if the second key value was not sequential? 2. Somewhat relating to question 1, if I used db_find_key with a key value of {1, 0} (assuming there will never be a record with a second key value of 0) I would get a negative result. If I am reading the docs right, the negtaive number would be the record number if it were inserted into the file. For example, if the db_find_key returned -4, would this mean that if I were to retrieve record 4, would it have a key value of {1, 1} (assuming key value {1, 1} is in the file)? 3. Let me say that I really like the simplicity and ease-of-use with the EDS. I have written programs using direct calls to Borland's Database Engine and it's not pretty. Jonas