APPX is the Premier Development and Runtime Environment for Business Application Software
(Category) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment :
Query Processes
FAQ's relating to the design of APPX Query Processes.
Subcategories:

Answers in this category:
(Answer) Query stops before processing entire file!
(Answer) Why doesn’t my QUERY use the file’s index?
(Answer) Can I create a Cached copy of a file to use in my pre-user selection event point?
(Answer) Is there a way to edit query and sort order screens?

[New Answer in "Query Processes"]
2004-Jul-09 4:50pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Query Processes :
Query stops before processing entire file!
When running a job/update process that uses a query, we got an Appx error during the selecting records phase. This was about 10000 records into the file, out of ~180000, and stated that it couldn't scratch the work file because the record length was invalid.
That's caused by a known bug in earlier versions of Appx. You can work around that problem by setting an environment variable, try this:
        APPX_RUN_MEM=2097150
This tells Appx to allocate 2MB to process a give query before it falls back to using an on-disk sort strategy.
[Append to This Answer]
2003-Nov-20 11:10am
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Query Processes :
Why doesn’t my QUERY use the file’s index?
A query for (FLD EQ "A") used the index on FLD to select records, a query for (FLD EQ 1) OR (FLD EQ 2) OR (FLD EQ 3) doesn't use the index, why? (Determined by looked in APPX QUERY LOG and saw what it was doing.)

The Query compiler currently (as of 4.1.9) stops looking for indexes once it runs into an OR condition.

Bruce Johnston Feb 5, '04: Starting in 4.1 you can use the new Query Event Point, Establish PCF Range, to boost performance where OR conditions are on leading portions of a key field. In the following example, a memory file, MCUST, contains customer master record keys of interest obtained using a prior scolling input... ...
      *                                                                         
      *        Customer of interest were supplied in an earlier input.          
      *                                                                         
      BEG READ DAR MCUST                  HOLD 0 KEY IS  MCUST CUSTOMER NO      
      BEG AT   DAR TRANSACT IN DAR MCUST CUSTOMER NO                            
      END AT   DAR TRANSACT IN DAR MCUST CUSTOMER NO                            
      BEG READ DAR TRANSACT               HOLD 0 KEY IS  TRANSACT KEY           
      GOSUB    --- PROCESS QUERY RECORD                                         
      END READ DAR TRANSACT                                                     
      END READ DAR MCUST                                                        
... This is effectively an OR condition for each value of MCUST CUSTOMER NO. You could have additional OR conditions on other key fields by simply cloning the above sequence and then modifying it. I have verified Steve's assertion that you can't end up with the same record selected twice.
Note that the presence of ANY code in this series even something as innocuous as a simple TRAP or comment line will disable the Fast Query which might otherwise occur on design/runtime criteria normally specified though additional selection criteria are honoured. The records acted upon by --- PROCESS QUERY RECORD are simply the only candidates considered for the selection criteria.
[Append to This Answer]
2004-Feb-05 6:40pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Query Processes :
Can I create a Cached copy of a file to use in my pre-user selection event point?
Yes, CREATE the cached file in Start of Query Execution
[Append to This Answer]
2004-Jul-09 4:49pm
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Query Processes :
Is there a way to edit query and sort order screens?
Yes (rel 4.2 and up). Look at 0LC 00: Inputs

QSLCT EDIT QSLCT EDIT (EXPR) QSORT EDIT

[Append to This Answer]
2004-Jul-09 4:50pm
Previous: (Category) Output Processes
Next: (Category) Update Processes
This document is: http://board.appx.com/cgi-bin/fom.cgi?file=28
[Search] [Appearance] [Show Top Category Only]
This is a Faq-O-Matic 2.719.
Copyright 2003 by APPX Software, Inc. All rights reserved.