Question
Most of my queries contain the same WITH clause. Can I replace it with a term?
Answer
If you frequently want to report on only data for the Southwest region, composed of customers whose zip codes begin with 75, you may want to create a term for the WITH clause. Here is how your term would look on the CA Dataquery EDITOR panel:
=> CREATION PANEL --------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR CURRENT TABLE: ________________________________ ------------------------------------------------------------------------------- NAME: SOUTHWEST______ TYPE: TERM__ STATUS: PRIVATE DESCRIPTION: WITH ZIP EQUAL '75#'_______________________________________ ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+. .. ================================ T O P ===================================== .. WITH ZIP EQUAL '75#' .. .. .. .. .. .. .. .. =========================== B O T T O M ================================== ------------------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> DISPLAY COLUMNS <PF4> DISPLAY KEYS <PF5> DISPLAY ALL <PF6> LIST TABLES <PF7> BACKWARD <PF8> FORWARD <PF9> TEMPLATE <PF10> VALIDATE <PF11> RIGHT/LEFT <PF12> PROCESS MODE
Here is how your term would look used in a query:
=> CREATION PANEL --------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR CURRENT TABLE: ________________________________ ------------------------------------------------------------------------------- NAME: SW-CUSTOMER-ADD TYPE: QUERY_ STATUS: PUBLIC_ DESCRIPTION: ___________________________________________________________ ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+. .. ================================ T O P ===================================== .. FIND ALL CAI-CUST-REC .. SOUTHWEST .. SORT BY (SLMN-ID) .. PRINT SLMN-ID .. CUST-ID .. CITY .. STATE .. PHONE .. =========================== B O T T O M ================================== ------------------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> DISPLAY COLUMNS <PF4> DISPLAY KEYS <PF5> DISPLAY ALL <PF6> LIST TABLES <PF7> BACKWARD <PF8> FORWARD <PF9> TEMPLATE <PF10> VALIDATE <PF11> RIGHT/LEFT <PF12> PROCESS MODE
Where you type SOUTHWEST in a query, CA Dataquery substitutes at execution time:
WITH ZIP EQUAL '75#'
If you want to produce reports on several regions, you may create terms to represent WITH clauses that identify each region.
|
Copyright © 2014 CA.
All rights reserved.
|
|