Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!uakari.primate.wisc.edu!ames!pasteur!ucbvax!mtxinu!sybase!violet!litzell From: litzell@violet.sybase.com (chuck litzell) Newsgroups: comp.databases Subject: Re: DBASE Set skip to... Message-ID: <7561@sybase.sybase.com> Date: 15 Dec 89 02:45:53 GMT References: <100@debet.nhh.no> <1844@naucse.UUCP> Sender: news@sybase.sybase.com Reply-To: litzell@violet.UUCP (chuck litzell) Organization: Sybase, Inc. Lines: 47 In article <1844@naucse.UUCP> wew@naucse.UUCP (Bill Wilson) writes: >From article <100@debet.nhh.no>, by si7_hn20587@debet.nhh.no (HALLVARD NATVIK NORWEGIAN SCHOOL OF ECO. AND BUSINESS ADMINISTRATION): >> Hello masters of Dbase IV >> >> Can any of you tell me exactly how the SET SKIP TO .... command in Dbase >> IV works? I understand that it has something with 1:many relationships >> to do, but what advantages do you get when you add it to the SET >> RELATION TO command? >>...... >In answer to the question (just in case it is academic), the set skip >command is used to see all the records from an associated database >that is related to a master base.... Actually... The version 1.0 manual isn't very clear on how SET SKIP TO works with multiple related database files. If you have several related files, SET SKIP TO lists the child files you want to "expand." The sequence of the files in the SET SKIP list isn't significant - the relation chain determines the order that records are processed. For example, USE Filea IN A USE Fileb IN B ORDER USE Filec IN C ORDER USE Filed IN D ORDER SET RELATION TO INTO B SELECT B SET RELATION TO INTO C SELECT C SET RELATION TO INTO D SELECT A SET SKIP TO Fileb, Filed With this setup, the records in Fileb and Filed are expanded, but not the records in Filec. When you advance the record pointer, all records in D that match the current record in C are processed before the record pointer advances in C. Then, since C isn't in the SET SKIP list, the record pointer is advanced in B, and C and D are repositioned according to the relation. When B no longer matches the relation expression in A, A advances to the next record, and the 3 child files reposition according to the relation. The key point is that only the first record in C that matches a record in B will ever be made available, while all records in B and D that have matching records in their parent files will be available.