No-optional access to secondary file (Quick)

Markus Grossrieder markus.grossrieder@alba-systems.com
Wed, 22 Mar 2000 17:57:43 +0100


David, Mark, John & John,

thanks for your help, but it's not actually what I was expecting/hoping.

Sure I could modify my database design, but I need just some 'on the fly'
screen to list some records, depending if there's a secondary file who meets
the condition (or simply exists), and who are just a few from some hundred
recods.
For this, I thought there is an option (in the FILE or ACCESS statement) who
permits to say if the access to the seconday file is optional or not,
without hardcoding my PATH/FIND procedures.

Mark's proposition works, but is not usefull for me (you're right, John).

The SELECT is not working, because I can't specify a file like in Quiz/QTP
(like SELECT A IF RECORD OF B EXIST), and SELECT B IF RECORD OF B EXIST
simply does nothing (creates a new record buffer for B if B doesn't exist).

So I will continue with generating and modifying PATH/FIND ... :(

Markus

----- Original Message -----
From: "Fry, Mark" <Mark.Fry@COGNOS.com>
> Rather than hard-coding your find procedure (and changing the 'get' on the
> secondary file), you could write a very simple postfind procedure to check
> whether the secondary file has been read successfully.
>
> PROCEDURE POSTFIND
> BEGIN
>   IF NEWRECORD OF B ;means the record was not read successfully by the
find
> procedure
>   THEN
>      ERROR = "Secondary record does not exist" ;or some other meaningful
> message
> END
>
> This relies upon the fact that the record buffer gets marked for
> initialization when a retrieval fails (and record status gets initialized
to
> TFF).
>
> Is this what you were looking for, or do you need to handle the
> non-existence of the secondary record more elegantly? [if so, you could
add
> the extra code to do this to the postfind procedure]
>
> Whatever...
>
> Mark Fry
> Cognos Limited
> email: Mark.Fry@Cognos.com
>
>  -----Original Message-----
> From: Markus Grossrieder [mailto:markus.grossrieder@alba-systems.com]
> Sent: 22 March 2000 13:41
> To: powerh-l@lists.swau.edu
> Subject: No-optional access to secondary file (Quick)
>
> Hi all,
>
> I want to select a primary file, depending if a secondary file exist (with
a
> given selection criteria).
> The only way to do this I found: cut the OPTIONAL option in the FIND
> procedure.
> Is therer an option/technique in the FILE statement which do this, without
> the need to have the explicit PATH/FIND procedures in my source ? (I'm
using
> PH 7.10G3 on OpenVMS)
>
> tia, Markus
>
> (Example:)
> FILE A PRIM OCCURS 15
>
> FILE B SECOND OCCURS WITH A
> ACCESS VIA KEY1 USING KEY1 OF A
> SELECT IF ITEMX = "X"
>
> PROCEDURE PATH
>   ...
>
> PROCEDURE FIND
>   BEGIN
>     FOR MISSING A
>       BEGIN
>        ...
>       ;GET B OPTIONAL
>       GET B                ;<- removed OPTIONAL for selection of A
>       END
>   END
>
>
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
=
> Subscribe: "subscribe powerh-l" in message body to
majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> This list is closed, thus to post to the list, you must be a subscriber.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.