[comp.databases] DBASE Set skip to...

si7_hn20587@debet.nhh.no (HALLVARD NATVIK NORWEGIAN SCHOOL OF ECO. AND BUSINESS ADMINISTRATION) (12/05/89)

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?

Unfortunately, I don't have access to the Ashton-Tate documentation, and the
books I have looked up either fully ignore or don't give any examples of
how the command is used.

Would you be able to give me a brief demonstration?

-Hallvard Natvik


========================================================================

wew@naucse.UUCP (Bill Wilson) (12/13/89)

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?
> 
> Unfortunately, I don't have access to the Ashton-Tate documentation, and the
> books I have looked up either fully ignore or don't give any examples of
> how the command is used.
>
I hope that you are not using an illegal copy of the product.  If you
are, it is not a good idea to ask questions on the net like this.

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.  For example (I am going from
memory):

sele 2
use classes index ssn
sele 1
use students
set rela to ssn into b
set skip on
list fields lname, fname, ssn, b->class, b-hours 

All the records in area two will print out for each ssn in area one.

-- 
Let sleeping dragons lie........               | The Bit Chaser
----------------------------------------------------------------
Bill Wilson             (Bitnet: ucc2wew@nauvm | wilson@nauvax)
Northern AZ Univ  Flagstaff, AZ 86011

litzell@violet.sybase.com (chuck litzell) (12/15/89)

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 <tag>
USE Filec IN C ORDER <tag>
USE Filed IN D ORDER <tag>
SET RELATION TO <exp> INTO B
SELECT B
SET RELATION TO <exp> INTO C
SELECT C
SET RELATION TO <exp> 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.