GET-statement with or without VIA option.

Deskin, Bob Bob.Deskin@Cognos.COM
Wed, 13 Feb 2002 08:29:50 -0500


A GET verb executed within any procedure except FIND and DETAIL FIND always
starts with a "get first". As soon as you cross procedure boundaries, QUICK
resets this and the next time you execute the procedure, you do the "get
first" again. Conversely, if you execute a GET with the same retrieval
options multiple times, you will do a "get first" followed by one or more
"get next". The exception to this is if you specify UNIQUE which forces a
"get first" or if you're retrieving from a non-PRIMARY|SECONDARY|DETAIL.

As for the VIAINDEX vs VIA issue, for non-relational, VIAINDEX establishes
the index to use and VIA establishes the segments for which you are
supplying values. If you don't say VIA, the USING values are assumed to be
from the first segment on. Without VIAINDEX, QUICK will determine the index
based on matching the VIA segments.

With relational, VIAINDEX is broken down into the corresponding columns and
effectively becomes a VIA. In addition, the VIAINDEX is used to generate an
order by.

There are lots of other subtleties but hopefully that's enough for now.

Bob Deskin              
PowerHouse Web Product Manager, Application Development Tools, Cognos Inc.
bob.deskin@cognos.com (613) 738-1338 ext 7268 FAX: (613) 727-1178
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA

-----Original Message-----
From: RessingM@unive.nl [mailto:RessingM@unive.nl]
Sent: Wednesday, February 13, 2002 8:04 AM
To: powerh-l@lists.swau.edu; chris.sharman@ccagroup.co.uk
Subject: AW: GET-statement with or without VIA option.


Chris,

the GET-statement I showed is performed from within an internal procedure.
That procedure is called from within the INITIALIZE-procedure, inside a
While retrieving on the file GEDD037Z (sequential).

The file DES1_GEDD037Z is an alias of GEDD037Z. I already put the OPEN
option on one of these files, to prevent a possible conflict.

Merol made a good suggestion that PowerHouse possibly can't match TNUENDRMNT
to the second index-item. I tested that (by providing ENUENDRMNT of GEDD037Z
instead of TNUENDRMNT), but that doesn't seem to be the case. It still goes
wrong.
Although it looks like the get-statement only retrieves using the first
key-item.

Here's the definition of GEDD037Z:
 <<Gedd037z.txt>> 
Greetings,

Martie Ressing



> ----------
> Van: 	Chris Sharman[SMTP:chris.sharman@ccagroup.co.uk]
> Verzonden: 	woensdag 13 februari 2002 11:56
> Aan: 	ressingm@unive.nl; powerh-l@lists.swau.edu
> Onderwerp: 	RE: GET-statement with or without VIA option.
> 
> 
> Yes, I think it should be the same.
> I don't think there were any relevant issues in 7.10.F2.
> What access statements have you got on the file ?
> Please post output of
> Qshow> sho rec des1_gedd037z
> as well as the quick file statement, access statements, field statement,
> and which procedure you're in.
> GET can conflict with lookup clauses during input/edit processing - if
> this
> is the case you're better with another file "alias other open 1".
> 
> Chris
> -----Original Message-----
> From: ressingm@unive.nl [mailto:ressingm@unive.nl]
> Sent: 13 February 2002 09:18
> To: mx% powerh-l@lists.swau.edu
> Subject: GET-statement with or without VIA option.
> 
> 
> Hello,
> 
> I have a question about using the VIA option on a GET-statement in Quick.
> In
> most cases I use only the VIAINDEX and the USING options to define a get
> statement. For example:
> 
> GET DES1_GEDD037Z &
>   VIAINDEX GEDD037A &
>   USING    ENUPLC OF GEDD037Z, &
>            TNUENDRMNT &
>   OPTIONAL
> 
> But this statement doesn't always retrieve the correct record and the
> problem is solved by adding the VIA option:
> 
> GET DES1_GEDD037Z &
>   VIAINDEX GEDD037A &
>   VIA      ENUPLC, ENUENDRMNT &
>   USING    ENUPLC OF GEDD037Z, &
>            TNUENDRMNT &
>   OPTIONAL
> 
> In my opinion both constructions should work identical (both using the
> same
> index-fields), but they don't, according to my test results.
> Does anyone have a suggestion what causes the difference ?
> 
> Additional information:
> PowerHouse version 7.10.F2
> Platform: OpenVMS 7.1 (DEC-Alpha)
> File-type: RMS, indexed
> 
> Greetings,
> 
> Martie Ressing
> Univé Verzekeringen
> Zwolle, The Netherlands
> 
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Mailing list: powerh-l@lists.swau.edu
> Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
> Unsubscribe: "unsubscribe" in message body to
> powerh-l-request@lists.swau.edu
> http://lists.swau.edu/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you must be a subscriber.
> --------------------------------------------------------------------------
> --
> ----
> Date: Wed, 13 Feb 2002 10:04:05 +0100
> 
> 
> 
> -----------------------------------------------------------------------
> 
> Any views expressed in this message are those of the sender and not
> necessarily those of CCA Group.  The unauthorized use, disclosure,
> copying or alteration of this message is forbidden.  The contents of
> this message may be confidential and/or privileged, copyright CCA Group
> and are intended solely for the use of the individual or entity to whom
> they are addressed.  Whilst this message has been scanned, CCA Group
> cannot guarantee that it is virus free or compatible with your systems
> and accepts no responsibility for any loss or damage arising from its
> use. The recipient is advised to run their own anti-virus software. If
> you receive this message in error please contact
> postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
> from your computer systems.
> 

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.