Hello,
If you've been reading my other nodes, you probably know that I've been learning how to use DBM and I'm pretty new at this. I currently have a database with the following structure:
CATALOG NUMBER (this is the hash key) | PIPE-DELIMINATED DATA | SORT NUMBER
The database is accessed in several ways:
- Displaying large groups of data. A beginning key and an ending key are specified and the program gets their sort numbers and prints everything in between, sorting the results by the sort number.
- Random access. A person specifies a group of keys and their records are returned, sorted by the sort number.
- Single-key access. A person enters a key and the database spits out the result.
The catalog number structure makes it seemingly impossible to sort by it (please correct me if I'm wrong!). It contains numbers like 219 or 614 but also ones like 751a or 930c. In addition, towards the end, there are numbers like C18 or E9. The subscripted numbers (ones like 751a) always come after their numerical counterparts (like 751). Example: 751a would come after 751. The catalog numbers with a prefix in front of them (like C18) always come at the end of the database. I can't do away with the catalog numbering system but I can't seem to figure out how to sort by it either.
My problem is this: I need to be able to add and delete keys from the database. When I add a key, how do I know what sort number I should use?
I would appreciate any suggestions of ways to fix this problem, or ways to simplify/optimize the way I currently do this. Thanks!
Stamp_Guy
Why is "abbreviated" such a long word?
Note: If further information would help, please /MSG me in the CB.