home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 184.lha / PubCat_v1.4 / query.doc < prev    next >
Text File  |  1988-04-28  |  13KB  |  272 lines

  1.                               Query Instructions
  2.        
  3.        
  4.        The Query program will  allow  you  to  produce a report based on
  5.        your selection,  sorting  and  formatting  specifications.   Upon
  6.        entry, you will be presented  with  a  data dictionary and string
  7.        gadgets  for  entering  your  record   selection  criteria,  sort
  8.        sequence and output report format.
  9.        
  10.        The data dictionary presents  you  with a list of data names that
  11.        can be used to display or print values contained in the database.
  12.        
  13.        The SELECT string gadget will allow you to specify some selection
  14.        criteria to be used to determine which  database  entries will be
  15.        included in you output display or report.  For example,
  16.        
  17.             SELECT:
  18.             (Author = "Smith" or "Jones") and Disk = "FF90"
  19.        
  20.        specifies that  the  database  is  to  be  searched  for programs
  21.        written by "Smith"  or  "Jones"  that  are  also  on disk "FF90".
  22.        Remember that in order  to  enter  data  into a string gadget you
  23.        must first position the pointer within the gadget and depress the
  24.        left button on  the  mouse.   Note  that  the  Select  parameters
  25.        contain  parentheses  to  prevent  ambiguities.   If  there  is a
  26.        possibility that the  key  word  or  phrase  you  are looking for
  27.        contains occurrences with both upper  and lower case letters, you
  28.        must check for both, e.g., "Smith" or "smith".  Another method is
  29.        to use the wild character, e.g., "?mith".
  30.        
  31.        The Sort string gadget will allow  you to specify the sequence in
  32.        which the selected records are  to  be displayed or printed.  For
  33.        example,
  34.        
  35.             SORT:
  36.             Disk
  37.        
  38.        specifies that the selected database  entries are to be sorted in
  39.        Disk name sequence.  Only one sort field may be entered.
  40.        
  41.        Note:  To sort on Date and have the resulting list appear in year
  42.        order, enter:
  43.        
  44.              cdate(Date)
  45.        
  46.        The REPORT string gadget will allow  you to specify the format of
  47.        the output display or report.  For example,
  48.        
  49.             REPORT:
  50.             Program, col 30, Version, col 40, Type
  51.        
  52.        specifies  that  the  Program  Name,  Version  and  Type  for the
  53.        selected entries are to be  displayed.   Further, it is specified
  54.        that Version is to be displayed  beginning  in column 30 and that
  55.        Type is to be displayed in  column  40.  If the column parameters
  56.        are omitted, the data items  will  be separated with one space in
  57.        the output.  The  REPORT  specification  parameters  may  be very
  58.        simple or very complex depending upon the skill of the user.
  59.        
  60.        Upon entering the Query  program,  you will find that the SELECT,
  61.        SORT and REPORT string gadgets  already  contain some parameters.
  62.        These parameters have been  designed  to provide a simple display
  63.        of all the entries in the catalog.   You may use these parameters
  64.        simply by selecting the  RUN  gadget,  or  you may enter your own
  65.        customized report  specifications.   To  erase the content on the
  66.        parameter  string  gadgets,  first  select  the  gadget  and then
  67.        depress Right AMIGA -  X.   To  undo  (cancel)  the  last editing
  68.        change to the  string,  depress  Right  AMIGA  -  Q.   The Report
  69.        specification parameters can be  classified  as either describing
  70.        "when to do it" or "what to do".
  71.        
  72.        When To Do It:
  73.                 
  74.                 page_top - specifies that subsequent functions are to be
  75.                 executed at the top each printed page or screen.
  76.                 
  77.                 page_bottom - specifies that subsequent functions are to
  78.                 the executed  at  the  bottom  of  each  printed page or
  79.                 screen.
  80.                 
  81.                 report_top - specifies that subsequent  functions are to
  82.                 be executed only at the beginning of the output report.
  83.                 
  84.                 report_bottom - specifies that  subsequent functions are
  85.                 to executed only at the end of the report.
  86.                 
  87.                 top(<data-name>) -  specifies  that subsequent functions
  88.                 are to be executed after there  has been a change in the
  89.                 content  of   <data-name>.    For   example,  top(Disk).
  90.                 Normally, the specified  data-name  will  be the same as
  91.                 the sort sequence.
  92.                 
  93.                 bottom(<data-name>)   -   specifies    that   subsequent
  94.                 functions are to be executed before there is a change in
  95.                 the content of data-name.  For example, bottom(Disk).
  96.                 
  97.                 detail - specifies that the subsequent  functions are to
  98.                 be executed for each selected database entry.
  99.                 
  100.        What To Do:
  101.        
  102.                 print - specifies that all output is to be routed to the
  103.                 printer.  Default values  for  tm, bm and bod are set to
  104.                 4, 8, and 54 respectively.
  105.                 
  106.                 display - specifies that  all  output is to be routed to
  107.                 the screen.  "Display" is  the  output default.  Default
  108.                 values for tm,  bm  and  bod  are  set  to  0, 0, and 22
  109.                 respectively.
  110.                 
  111.                 tm nn - sets the top  margin  for  the output display or
  112.                 report to the value specified by nn.
  113.                 
  114.                 bm nn - sets the bottom margin for the output display or
  115.                 report to the value specified by nn.
  116.                 
  117.                 bod nn - sets the body of  the  output display or report
  118.                 to the value specified by nn.  The sum of tm, bm and bod
  119.                 must equal the desired page length.
  120.                 
  121.                 <data-name> -  causes  the  specified  data  name  to be
  122.                 printed  or  displayed.  For  example,  "Remarks"  is  a
  123.                 data-name.
  124.                 
  125.                 "literal" - causes the  specified  literal to be printed
  126.                 or  displayed.   For  example,  "The  result  is:"  is a
  127.                 literal.
  128.                 
  129.                 trim(<data-name>) - causes the specified data name to be
  130.                 printed or displayed after all trailing spaces have been
  131.                 eliminated.  For 
  132.                 example,
  133.                 
  134.                         "trim(Remarks)".
  135.                 
  136.                 total(<data-name>) - specifies  that the summed value of
  137.                 <data-name> is to be  printed  or displayed.  An numeric
  138.                 data item  from the dictionary or a numeric literal must
  139.                 be substituted for <data-name>.  For example, to print a
  140.                 count of the entries selected for the report enter:
  141.                 
  142.                         report_bottom total(1)
  143.                 
  144.                 cum(<data-name>)  -   same  as  total  except  that  the
  145.                 accumulator is not reset  after  displaying  the result.
  146.                 To consecutively number  items  appearing  in the output
  147.                 report, enter:
  148.                 
  149.                         detail cum(1) "%999"
  150.                 
  151.                 spacer nn - causes  nn  spaces  to  be  inserted between
  152.                 output data items.  The default is 1.
  153.                 
  154.                 col nn - causes  the  next  specified  data  item  to be
  155.                 displayed or printed in the column specified by nn.
  156.                 
  157.                 skip n - causes n lines to be  skipped before displaying
  158.                 or printing the next data item.  If n is not provided, 1
  159.                 is assumed.
  160.                 
  161.                 pause - causes a pause in  the  output process until the
  162.                 space bar is depressed.
  163.                 
  164.                 eject - if "print"  has  been  specified,  this  command
  165.                 causes the paper to be  ejected  to  the top of the next
  166.                 page; otherwise, the screen will be cleared.
  167.                 
  168.                 
  169.                 EDITING MASKS
  170.                 
  171.                 Numeric Editing Masks may  be  used  to cause predefined
  172.                 characters to be imbedded  within  displayed  or printed
  173.                 numeric items.  Numeric items are identified in the data
  174.                 dictionary with  the  character  "n"  following the data
  175.                 name.  The masks must be constructed  as an alphanumeric
  176.                 literal whose  first  character  is  "%".  If the second
  177.                 character of the mask  literal  is  other than a numeric
  178.                 character, that  character  will  be  placed in the next
  179.                 left most position before  the  resulting edited numeric
  180.                 value.
  181.                 
  182.                 Examples:
  183.                 
  184.                      Input Values       Mask         Output
  185.                 
  186.                          01000        "%9,999"        1,000
  187.                 
  188.                          25245      "%$99,999"      $25,245
  189.                 
  190.                          -5643     "%$999,999"      $-5,643
  191.                 
  192.                 Alphanumeric  Editing   Masks   may  be  used  to  cause
  193.                 predefined characters to be imbedded within displayed or
  194.                 printed  alphanumeric  items.   Alphanumeric  items  are
  195.                 identified in the data dictionary with the character "c"
  196.                 following the data name.   The  mask must be constructed
  197.                 as an alphanumeric literal whose first character is "%".
  198.                 
  199.                 Examples:
  200.                 
  201.                      Input Values        Mask        Output
  202.                 
  203.                        123456789     "%@@@-@@-@@@@"  123-45-6789
  204.                 
  205.                        102786        "%@@/@@/@@"     10/27/86
  206.                 
  207.        
  208.        Here is an example of a  more  complex  query  that  print a disk
  209.        label for the selected entries:
  210.        
  211.        
  212.        SELECT:
  213.        Program = "?"
  214.        
  215.        SORT:
  216.        Disk
  217.        
  218.        REPORT:
  219.        print tm 1 bod 4 bm 1 bottom(Disk) "JANE DOE COLLECTION" skip
  220.              Disk "Size:" total(Size) "%99999" eject
  221.        
  222.        By using the BOTTOM command,  only  one label is printed for each
  223.        unique Disk Name in your database.  The name of the collection is
  224.        printed on the top line and the disk  name and size is printed on
  225.        the second line.
  226.        
  227.        These parameters are set  for  5/16  labels.   For other sizes of
  228.        labels, simply adjust the margin parameters.
  229.        
  230.        
  231.        Rules:
  232.        
  233.             (1)  The Select statement may contain these operators:
  234.        
  235.                     =  Equal to
  236.                     <> Unequal to
  237.                     <  Less than
  238.                     >  Greater than
  239.                     <= Less than or equal to
  240.                     >= Greater than or equal to
  241.        
  242.             (2)  The field on the left side  of  the  operator must be a
  243.        data name from the dictionary.
  244.        
  245.             (3)  The field on the  right  side  of  the  operator may be
  246.        either a data name or  literal.    Literals  must  be enclosed in
  247.        double quotes.
  248.        
  249.             (4)  In the case of equal and unequal,  the data name on the
  250.        left side of the operator is searched  for any occurrences of the
  251.        data specified on the right of the operator.
  252.        
  253.             (5)  The length of the item to the right of the operator may
  254.        not be greater than the  length  of  the  item to the left of the
  255.        operator.
  256.        
  257.             (6)  When used in a literal, the "?"  is wild.  For example,
  258.        to select all records in the database enter:
  259.        
  260.                    SELECT:
  261.                    Author  = "?"
  262.        
  263.             (7)  Commas may used to improve readability; otherwise, they
  264.        serve no useful purpose.
  265.        
  266.             (8)  All data names must be capitalized.  All other commands
  267.        must be in lower case.
  268.        
  269.        If your printer carriage is 80 columns in width, try setting your
  270.        printer preferences for compressed mode in order to print reports
  271.        that are greater than 80 characters in width.
  272.