steed@digitm.UUCP (Steed Kulka) (02/06/91)
We have found AVision not coherent on selecting db records depending whether a key field is numeric or string. It may be a bug, a "feature", or we are just missing some important point. When you select a database record using a string variable whose actual value may reference several records, AV selects the first record in list, and this is fine; but when the key field is numeric, AV selects the last record in list. Consider a record whose fields are: >CODE I NAME S >ORD# I Records in database are: 1 1 1 2 3 HUEY DEWEY LOUIE DONALD DAISY 1 2 3 4 5 Now assign variable <searchnum=1> and select record: >CODE : searchnum then read record: >CODE NAME resultname >ORD# resultord <resultname> is now "LOUIE" and <resultord> is 3. If field NAME was a key field and you searched the letter "D", AV would have selected record #2, the first whose NAME field starts with that letter. Any comment/hint/trick/suggestion on how to have record selection behaving the same way in both cases? Thank you in advance. -- _ _ _ ___ __ (_) | \|/ _| | |_ /\ |\/| Steed Kulka ----- |_/|\_/| | |__/--\| | BIX: digiteam UUCP: {uunet|pyramid|rutgers}!cbmvax!cbmehq!cbmita!digitm!steed
peterk@cbmger.UUCP (Peter Kittel GERMANY) (02/08/91)
In article <00309.AA00309@digitm.UUCP> steed@digitm.UUCP (Steed Kulka) writes: > >When you select a database record using a string variable whose actual value >may reference several records, AV selects the first record in list, and this >is fine; but when the key field is numeric, AV selects the last record in list. > >Consider a record whose fields are: >>CODE I >NAME S >>ORD# I > >Records in database are: >1 1 1 2 3 >HUEY DEWEY LOUIE DONALD DAISY >1 2 3 4 5 > >Now assign variable <searchnum=1> and select record: >>CODE : searchnum > ><resultname> is now "LOUIE" and <resultord> is 3. > >If field NAME was a key field and you searched the letter "D", AV would have >selected record #2, the first whose NAME field starts with that letter. Sorry, don't know about AV internals, I only can guess. In fact, you don't search for the same set of records in your example. So the order in which the selected records get presented may be incidentally and may mirror the physical storage order of the records. The select mechanism is said to give you all matching records when you process them in child icons, but there is no word made about the order inside this selected set. But as I said, this is pure speculation. A better test would be to set up a test database where you have some records that result in exactly the same selection by integer or string fields. (Was too lazy to try this myself :-) -- Best regards, Dr. Peter Kittel // E-Mail to \\ Only my personal opinions... Commodore Frankfurt, Germany \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk