|
I don't know if you're aware of the Focus 'CHECK FILE PICTURE' command
(...see Focus Users Manual Chapter 12...) but I think it may help you
understand your problem.
To begin with, Focus is a _HIERARCHICAL_ database system and NOT a
RELATIONAL database system. When you create a Focus description of
two or more relations of a RDB database, Focus views the relations
as a pseudo-hierarchical structure depending on how they are described
in the .MAS and .ACX files.
Therefore, in your original example, Focus will see the relations as
the following structure:
HEADER
01 S0
**************
*FIELD1 **
*FIELD2 **
*FIELD3 **
*FIELD4 **
* **
**************
I
I
I DETAILS
02 I S0
**************
*FIELD1 **
*FIELD2 **
*FIELD3 **
*FIELD4 **
* **
**************
I
I
I PARTS
03 I S0
**************
*FIELD1 **
*FIELD2 **
*FIELD3 **
*FIELD4 **
* **
**************
This is a straight line hierarchy and all the fields would be available
for any request.
However in your second scenario, I think you have linked the relations
into the following structure:
DETAILS
01 S0
**************
*FIELD1 **
*FIELD2 **
*FIELD3 **
*FIELD4 **
* **
**************
I
I
I--------------------I
I I
I HEADER I PARTS
02 I S0 03 I S0
************** **************
*FIELD1 ** *FIELD1 **
*FIELD2 ** *FIELD2 **
*FIELD3 ** *FIELD3 **
*FIELD4 ** *FIELD4 **
* ** * **
************** **************
Focus can only access data using one 'path' through the database
structure at one time.
In the above example, when retrieving data in a 'TABLE' request,
Focus will start access through the DETAILS relation and then can
proceed down the structure to _EITHER_ the HEADER relation _OR_ the
PARTS relation...BUT NOT BOTH SIMULTANEOUSLY!!
If your request contains fields from both the HEADER and PARTS
relations, then Focus will generate the error message you have been
seeing.
If the second structure is the one you want, there is a way to get
data from both paths out in a 'single' request using the 'MATCH'
command. But that's another story...
David Carse - European ADG, Basingstoke
|
| From: PICA::COYLE 12-JAN-1990 19:14:16.02
To: ILO::BROCKLEBANK
CC:
Subj: Have you tried this?
Hi Dave,
Don't know if you've had any more luck, but have you tried the following:
SEGNAME=ORD_DET,SEGTYPE=S0
...
SEGNAME=PARTS,SEGTYPE=S0,PARENT=ORD_DET
...
SEGNAME=ORD_HEAD,SEGTYPE=U,PARENT=ORD_DET
...
In this case you are making ORD_HEAD a unique segment.
Let me know how you make out.
Thanks,
KC
|
| Re Note .3
David I don't understand why FOCUS can't retrieve data from 2
child relations linked to the same parent. Any further info
would be useful.
Re Note .4
Kevin's solution to make the Header child relation a Unique
segment worked. The good thing about this solution is that
now all reports which use fields in the Detail relation
access this relation first. Thus using the RdB index on the
date field, the most efficient search strategy is used.
Because our RdB is so big (2 years history of orders), this
search strategy of using an RdB index on DATE_INVOICED has
increased the performance by 500%.
Thanks to the replies on this problem.
Regards,
Dave
|