home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / v20_eval.zip / XYQ.INF (.txt) < prev    next >
OS/2 Help File  |  1996-04-18  |  1MB  |  8,092 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Special notices and trademarks information ΓòÉΓòÉΓòÉ
  3.  
  4. No part of this document may be reproduced or transmitted in any form or by any 
  5. means, electronic or mechanical, for any purpose, without the prior written 
  6. consent of Xyratex. The data used in all examples herein is fictitious unless 
  7. otherwise noted. 
  8.  
  9. Copyright Havant International Ltd. 1995,1996. All rights reserved. 
  10.  
  11. Xyratex is the trading name of Havant International Limited. 
  12.  
  13.    Xyratex
  14.    P.O. Box 6
  15.    Havant
  16.    Hampshire
  17.    PO9 1SA
  18.    United Kingdom
  19.  
  20. Telephone: +44 (0) 1705 443177
  21.  
  22. Fax:       +44 (0) 1705 492228
  23.  
  24. Xyratex, Xyratex Query for OS/2 and XY-Query are trademarks of Havant 
  25. International Limited. 
  26.  
  27. The following are all trademarks of International Business Machines 
  28. Corporation: 
  29.  
  30. AIX, AS/400, Database 2 OS/2, Database Manager, DB2, DB2/2, DB2/400, DB2/6000, 
  31. DDCS/2, DDCS/6000, DDQS/2, Distributed Relational Database Architecture, DRDA, 
  32. Extended Services, IBM, IBM SAA Distributed Database Connection Services/2, 
  33. OS/2, OS/2 Procedures Language 2/REXX, Presentation Manager, QMF, SQL/DS. 
  34.  
  35. Microsoft, Windows and Excel are trademarks of Microsoft Corporation. 
  36.  
  37. Intel and 80386 are trademarks of Intel Corporation. 
  38.  
  39. Lotus 1-2-3 is a trademark of Lotus Corporation. 
  40.  
  41. XDB is a trademark of XDB Systems Inc. 
  42.  
  43.  
  44. ΓòÉΓòÉΓòÉ 2. Version Notice ΓòÉΓòÉΓòÉ
  45.  
  46. First Edition April 1996 
  47.  
  48. This edition applies to Release 2.0 of Xyratex Query for OS/2, and all 
  49. subsequent releases and modifications. 
  50.  
  51. Printed in England. 
  52.  
  53. Written by Brian Paine. 
  54.  
  55.  
  56. ΓòÉΓòÉΓòÉ 3. About XY-Query ΓòÉΓòÉΓòÉ
  57.  
  58.  
  59. ΓòÉΓòÉΓòÉ 3.1. Product overview ΓòÉΓòÉΓòÉ
  60.  
  61. Xyratex Query for OS/2 (XY-Query) is an interactive query development 
  62. application. It is a Presentation Manager application that runs on OS/2, 
  63. providing access to IBM and XDB local and remote relational databases. 
  64.  
  65. XY-Query can be installed in standalone, database client-only and database 
  66. server configurations.  Remote data access to DB2 family locations is achieved 
  67. using the IBM SAA Distributed Database Connection Services /2 (DDCS/2) database 
  68. gateway product. 
  69.  
  70. XY-Query offers the flexibility to accommodate users with varying degrees of 
  71. SQL proficiency.  It does not inhibit power users who are familiar with SQL, 
  72. but it also supports the less experienced user through its easy-to-use Query 
  73. Builder function. 
  74.  
  75. Users with no knowledge of SQL can still benefit from the power and flexibility 
  76. of XY-Query by using pre-built objects that can request and display the 
  77. required data in a specific format. 
  78.  
  79. The application is compact, offering key query management services in an easily 
  80. navigable environment without using excessive resources. 
  81.  
  82. XY-Query offers the following advantages: 
  83.  
  84.      Provides a single interface for queries and reporting on DB2, SQL/DS, 
  85.       DB2/400, DB2/6000, DB2/2 and XDB relational databases 
  86.      Supports Extended Services Database Manager databases 
  87.      Provides step-by-step assistance for query-building 
  88.      Allows dynamic table updates 
  89.      Provides comprehensive report formatting 
  90.      Displays data in various chart formats 
  91.      Offers REXX procedures interface 
  92.      Can save data as tables at local and remote locations 
  93.      Can directly import and run existing Query Manager queries and QMF 
  94.       queries from DB2 and SQL/DS 
  95.      Can directly import and run queries from XDB 
  96.      Can be invoked via DDE to enable data retrieval directly into spreadsheet 
  97.       applications 
  98.      Highly tailorable using its Settings facility 
  99.  
  100.  Note:  This guide does not include instructions for writing SQL. 
  101.  
  102.  
  103. ΓòÉΓòÉΓòÉ 3.2. How to use this guide ΓòÉΓòÉΓòÉ
  104.  
  105. This guide is intended to provide a complete reference for XY-Query. It 
  106. explains how: 
  107.  
  108.      To install XY-Query 
  109.  
  110.       If you have not yet installed XY-Query,see chapter Installing XY-Query to 
  111.       find out how to install XY-Query. 
  112.  
  113.  
  114.      To start using XY-Query 
  115.  
  116.       If you are new to XY-Query, you are recommended to start with chapter 
  117.       Getting started with XY-Query to chapter Opening and closing XY-Query. 
  118.       These chapters show you how to use XY-Query and to run queries. 
  119.  
  120.  
  121.      To use XY-Query's facilities 
  122.  
  123.       Once you are familiar with the basic operations of XY-Query, refer to 
  124.       chapter XY-Query windows to chapter Using XY-Query with spreadsheets. 
  125.       These chapters tell you how to use the facilities provided by XY-Query. 
  126.  
  127.  All users of XY-Query, irrespective of their previous experience, should find 
  128.  this book a valuable reference to help them use the product successfully and 
  129.  gain the most benefit from the advantages XY-Query gives. 
  130.  
  131.  
  132. ΓòÉΓòÉΓòÉ 4. Getting started with XY-Query ΓòÉΓòÉΓòÉ
  133.  
  134.  
  135. ΓòÉΓòÉΓòÉ 4.1. Welcome ΓòÉΓòÉΓòÉ
  136.  
  137. Welcome to XY-Query. We have designed XY-Query to be as easy to use as we can, 
  138. yet it has many features and is as comprehensive as any database expert could 
  139. wish. Later chapters in this book will show you how to use the product in full. 
  140.  
  141. This chapter is intended to get you going, and to show you how easy it is to 
  142. retrieve and display data and then plot a chart from information extracted by 
  143. running a query. You can use a sample database so that you can practice on test 
  144. data and learn how easy it is to use XY-Query. 
  145.  
  146. If you haven't installed XY-Query yet, go to chapter Installing XY-Query. 
  147. Installation is very straightforward as XY-Query comes on only two diskettes 
  148. and only takes a matter of minutes. 
  149.  
  150. We have to make some assumptions about your environment, primarily that you 
  151. have your data in a local database. If your data is not local to your PC, for 
  152. example, if it is on a mainframe you may not have access to it. If so, you may 
  153. have to seek help from your support personnel who should be able to provide 
  154. assistance in setting up the correct connections. See Connecting to remote DB2 
  155. databases. Even if you have a local database, then we suggest you use the 
  156. SAMPLE database that comes with DB2/2 or the TUTORIAL location for XDB users. 
  157. The samples that come with XY-Query use these two data sources. 
  158.  
  159. The examples that will be described in this manual are based around the DB2/2 
  160. SAMPLE database. 
  161.  
  162. Refer to Creating the DB2/2 sample database. to find out how to install this 
  163. database if necessary. 
  164.  
  165. As you familiarise yourself with the product you will see that XY-Query aims to 
  166. do as many things as possible for you. For example, knowing just a location and 
  167. a table name is enough to allow you to construct a valid SQL query, run it and 
  168. display the data returned as both text and graphically as a chart. 
  169.  
  170.  
  171. ΓòÉΓòÉΓòÉ 4.2. Open the product folder ΓòÉΓòÉΓòÉ
  172.  
  173. To start, open the XY-Query desktop folder by double-clicking on the icon 
  174. labelled Xyratex Query for OS/2 (the full product name) that is on your OS/2 
  175. desktop: 
  176.  
  177. Xyratex Query for OS/2 product icon 
  178.  
  179. Within this folder you can see a number of other icons. The purpose of these 
  180. icons is explained in more detail in chapter What does XY-Query look like?. 
  181.  
  182.  
  183. ΓòÉΓòÉΓòÉ 4.3. Start the XY-Query program ΓòÉΓòÉΓòÉ
  184.  
  185. Start XY-Query by double clicking the XY-Query icon. 
  186.  
  187. XY-Query program icon 
  188.  
  189. You are presented with the SQL window which contains the Query Builder. You use 
  190. the Builder to make decisions about the data you want to retrieve. It builds 
  191. SQL statements for you but you need not see the SQL if you do not want to. As 
  192. soon as you have given the Builder enough information, it is able to run a 
  193. query when asked. You can see this because the Run button on the top toolbar 
  194. turns green when ready. 
  195.  
  196.  
  197. ΓòÉΓòÉΓòÉ 4.4. Work through the builder ΓòÉΓòÉΓòÉ
  198.  
  199. By working through the builder you can construct a query of your choice. The 
  200. Builder consists of a number of panels with which you can interact to specify 
  201. details of the query. 
  202.  
  203.      Initially, you are presented with the Select SQL Statement panel. From 
  204.       here you can choose the type of query to build and run. This tutorial 
  205.       assumes that most queries you run will be SELECT and this option is 
  206.       already chosen from the list. 
  207.      Press the Location button on the lower toolbar to show the available 
  208.       locations. (You should see some Floating Help displayed for a short time 
  209.       each time you place the mouse pointer over a toolbar button). 
  210.  
  211.       Double click the entry for SAMPLE to obtain a list of tables at the 
  212.       location. At this point, enter your userid and password if requested to 
  213.       gain access to the database.  If you have problems here, get help from 
  214.       your Database Administrator. Once access is obtained, the Builder 
  215.       progresses automatically to the Select Tables panel where the available 
  216.       tables are listed for you. 
  217.      Next choice is the table.  XY-Query has already displayed any tables 
  218.       owned by your current userid. Select the STAFF table from the list of 
  219.       table names and then press the ADD button. You have now specified enough 
  220.       information to make it possible to run a query. 
  221.  
  222.  
  223. ΓòÉΓòÉΓòÉ 4.5. View and run your query ΓòÉΓòÉΓòÉ
  224.  
  225. You can if you wish view the raw SQL that corresponds with what has been 
  226. specified in the Builder. Do this by pressing the Edit Sql button on the top 
  227. toolbar. To switch back into the Builder, press the Builder button on the same 
  228. toolbar. 
  229.  
  230. To run the query that has been specified so far, press the Run button on the 
  231. top toolbar. 
  232.  
  233. Tip-  You can obtain context sensitive help by moving the cursor to a specific 
  234. field and pressing the F1 key. Each XY-Query dialog has associated help which 
  235. you obtain by pressing the button labelled Help. In the Builder, you display 
  236. help by pressing the Help button on the bottom toolbar. 
  237.  
  238.  
  239. ΓòÉΓòÉΓòÉ 4.6. Display the Viewer ΓòÉΓòÉΓòÉ
  240.  
  241. As the data is retrieved from the database, XY-Query opens a window known as 
  242. the Viewer to display it. You can see the data displayed with the column 
  243. headings exactly as extracted from the database. This is the standard format of 
  244. the Viewer and the initial presentation is quite simple. 
  245.  
  246. However, with a few modifications the report can be enhanced with various 
  247. colours and fonts and be provided with headings, footings, subtotals and 
  248. totals, making it suitable for direct presentation. The tool used for this is 
  249. the Settings Notebook called from the Settings button on the Viewer toolbar, 
  250. For now though, concentrate on refining your query. 
  251.  
  252.  
  253. ΓòÉΓòÉΓòÉ 4.7. Refining your query ΓòÉΓòÉΓòÉ
  254.  
  255. The query you just ran retrieved all the data in the STAFF table, that is all 
  256. the rows and all the columns. You can now refine this in a number of ways by: 
  257.  
  258.      Reducing the number of columns 
  259.      Defining your own calculated columns 
  260.      Sorting the data that is returned 
  261.      Limiting the range of the data retrieved 
  262.  
  263.  All these are managed from different panels of the Builder accessed from the 
  264.  buttons on the bottom toolbar. 
  265.  
  266.  Refine your query as follows: 
  267.  
  268.    1. Specify columns- by pressing the Select Columns... button 
  269.  
  270.       You get a list of the columns in the table. All are selected because 
  271.       initially all the data was selected. 
  272.  
  273.       Press the Deselect All button then select the columns you want from the 
  274.       list. For this example select the columns NAME, DEPT, SALARY  and COMM. 
  275.    2. Select specific rows- by pressing the Select Rows... button 
  276.  
  277.       Choose the column you want to limit from the first list (SALARY), choose 
  278.       the limiting method (=,>,< etc) from the next list (<) and finally 
  279.       specify the limiting value in the right hand entry field (20000). 
  280.  
  281.       Press the Add button to cause the statement SALARY < 20000 to appear in 
  282.       the box at the bottom of the panel. 
  283.  
  284.       When the query is re-run this statement will have the effect of reducing 
  285.       the amount of data retrieved by the query to only that which matches this 
  286.       condition. 
  287.    3. Sort the data by pressing the Order rows... button 
  288.  
  289.       You then select the columns to sort on and the relevant sequences 
  290.       (ascending or descending). In this example, firstly ensure the Ascending 
  291.       button is checked and then select the DEPT entry from the list. 
  292.    4. Run your amended query when the Builder activity has completed, by 
  293.       pressing the Run button and obtain another extract. 
  294.  
  295.       You can now see that there are only the four columns, a reduced number of 
  296.       rows and that the data is in ascending department order. 
  297.  Tip- Accelerator keys are listed alongside many of the menu options in the 
  298.  XY-Query window menus.  You can use the accelerator keys instead of selecting 
  299.  items from the menus or toolbars. 
  300.  
  301.  
  302. ΓòÉΓòÉΓòÉ 4.8. Improving the appearance of the report ΓòÉΓòÉΓòÉ
  303.  
  304. To smarten up the report, press the Settings button on the Viewer toolbar. 
  305.  
  306. Tip-  With the mouse pointer over the window, click the right-hand mouse button 
  307. to see the Settings Notebooks. 
  308.  
  309. Once Settings is opened, you can change parameters.  For now, focus on the 
  310. column headings and add some totals. 
  311.  
  312. The Viewer Settings Notebook has a page for each aspect of the report. It opens 
  313. at Columns. Start there by altering the usage of the SALARY and COMM columns. 
  314.  
  315. Do the following: 
  316.  
  317.    1. Rotate the Name field until SALARY appears. 
  318.    2. Drop the Usage list and select SUM. 
  319.    3. Press Apply and see the changes reflected immediately in the report. 
  320.    4. Move the Name field to read COMM. 
  321.    5. Select AVG from the Usage list. 
  322.    6. Press Apply and see the changes reflected immediately in the report. 
  323.    7. Rotate the Name field to read DEPT. 
  324.    8. Select Centre from the Alignment list. 
  325.     9.
  326.  
  327.  Now, to display the data in the SALARY and COMM columns as monetary values. 
  328.  
  329.    1. Select the tab for the Country page. 
  330.    2. Rotate the Name field until it reads SALARY. 
  331.    3. Enter the currency symbol you want use for this column. 
  332.    4. Press either the Suffix: or Prefix button. 
  333.    5. Press Apply and see the changes reflected immediately in the report. 
  334.    6. Rotate the Name field until it reads COMM and repeat actions, possibly 
  335.       specifying a different currency symbol or position for this column. 
  336.  
  337.  Now, to smarten the titles, do the following: 
  338.  
  339.    1. Select the tab for the Titles page. 
  340.    2. Rotate the Name field until it reads SALARY. 
  341.    3. Alter the Data field to read Salary. 
  342.    4. Change the alignment field to read Centre. 
  343.    5. Press the Apply button and see the column title displayed in the Viewer 
  344.       change dynamically. 
  345.    6. Repeat steps 2 to 5 changing COMM to Commission, DEPT to Dep't and NAME 
  346.       to Employee_Name. 
  347.  
  348.  You can change the colour of these titles later. 
  349.  
  350.  Next however, complete the totalling by making the report break wherever the 
  351.  department number changes as follows: 
  352.  
  353.    1. Select the Break tab to show the Break page. 
  354.    2. Select Dep't from the list. 
  355.    3. Press the Apply button and see the Report change immediately. 
  356.  
  357.  The total effect of the changes made so far is that the report is now divided 
  358.  into department sections with each departmental salary bill sub-totalled and a 
  359.  grand total at the bottom.  The column titles have changed to be more 
  360.  understandable. 
  361.  
  362.  To change the colour of the titles, do the following: 
  363.  
  364.    1. Select the Presentation tab. 
  365.    2. Rotate the Region field until it reads Column Titles. 
  366.    3. Click the colour red in the palette. 
  367.    4. Press the Apply button to make the changes. 
  368.  
  369.  Try making a few changes of your own. Explore the various regions that the 
  370.  Viewer comprises and give them different colours and fonts.  You can see the 
  371.  effect on the report as soon as you apply it. If you choose an effect you 
  372.  don't want then either change back or press the Default button to reset. 
  373.  
  374.  
  375. ΓòÉΓòÉΓòÉ 4.9. Display a Chart ΓòÉΓòÉΓòÉ
  376.  
  377. Make a chart from your data is just as easy. Once the data is extracted, press 
  378. the Chart button on the Viewer or SQL window toolbar to display a chart. The 
  379. default is a 3D bar chart, but as with everything else in XY-Query, you can 
  380. change it to match your own personal preferences. 
  381.  
  382.  
  383. ΓòÉΓòÉΓòÉ 4.10. Tailor the Chart ΓòÉΓòÉΓòÉ
  384.  
  385. You can tailor the Chart using a Settings Notebook specifically for the Chart 
  386. window. To display the window, press the Settings button on the toolbar, You 
  387. can change both the type of chart displayed and many display attributes and 
  388. styles. Try changing a few colours and fonts and you will see that, like the 
  389. Viewer, the Chart can be tailored extremely easily. 
  390.  
  391.  
  392. ΓòÉΓòÉΓòÉ 4.11. Where next ? ΓòÉΓòÉΓòÉ
  393.  
  394. The Samples folder is a good place to start. In there you will find two 
  395. distinct sets of examples, one for DB2/2 and one for XDB, that will show you 
  396. the many different ways you can use XY-Query  You will also find XY-Query 
  397. Procedures which let you use the XY-Query facilities in a REXX program. 
  398.  
  399. As you will have discovered, XY-Query is truly easy to use. In this tutorial 
  400. you have experienced just a few of the features. Take your time to explore the 
  401. product and try a few experiments. There is comprehensive contextual help for 
  402. every window and control, and this book explains every functional area of the 
  403. product. 
  404.  
  405. Happy querying. 
  406.  
  407.  
  408. ΓòÉΓòÉΓòÉ 5. What does XY-Query look like? ΓòÉΓòÉΓòÉ
  409.  
  410.  
  411. ΓòÉΓòÉΓòÉ 5.1. The XY-Query desktop ΓòÉΓòÉΓòÉ
  412.  
  413. When XY-Query is installed, assuming you have requested that your desktop is 
  414. updated, the following product icon will be placed on your OS/2 desktop. 
  415.  
  416. XY-Query desktop icon 
  417.  
  418. This icon represents the folder in which XY-Query is stored. When the folder is 
  419. opened it will look as follows: 
  420.  
  421. XY-Query desktop folder 
  422.  
  423. The folder contains the following objects from left to right: 
  424.  
  425.      A folder labelled Work you can use for storing XY-Query objects you 
  426.       create. 
  427.      A folder labelled Template containing templates for SQL, Viewer, Chart 
  428.       and Procedure objects. 
  429.      A folder labelled Samples which contains 2 further folders labelled DB2 
  430.       and XDB. These contain example XY-Query objects created to highlight some 
  431.       of the features offered by XY-Query. The folders indicate the database 
  432.       system against which the examples are targetted. 
  433.      An XY-Query program icon used to start a new untitled XY-Query session. 
  434.      An icon labelled Settings used to define defaults for your XY-Query 
  435.       system 
  436.      A book icon that you select to obtain the on-line version of this book. 
  437.      An icon labelled Remove used to remove XY-Query. 
  438.  
  439.  As elsewhere in OS/2, folders can be renamed as required and objects can be 
  440.  stored within them in the way most convenient for you.  Each XY-Query object 
  441.  has a menu which you open in the normal way by pointing to the object and 
  442.  clicking the right-hand mouse button. 
  443.  
  444.  
  445. ΓòÉΓòÉΓòÉ 6. XY-Query Objects ΓòÉΓòÉΓòÉ
  446.  
  447.  
  448. ΓòÉΓòÉΓòÉ 6.1. XY-Query objects ΓòÉΓòÉΓòÉ
  449.  
  450. There are four types of XY-Query object: 
  451.  
  452.      SQL 
  453.      Viewer 
  454.      Chart 
  455.      Procedure 
  456.  
  457.  The are represented on the desktop as icons as shown in XY-Query object icons. 
  458.  
  459.  XY-Query object icons 
  460.  
  461.  These four objects fall into two categories. The first covers the SQL, Viewer 
  462.  and Chart objects and the second, the Procedure object. 
  463.  
  464.  A standard use of XY-Query is to write an SQL query, execute it and show the 
  465.  results both as data in the Viewer and graphically as a Chart. The query, 
  466.  together with all the presentation styles and settings for the SQL, Viewer and 
  467.  Chart windows form the content of the first object type. The creator of the 
  468.  object decides which object type is relevant depending upon how it will be 
  469.  used and by whom. 
  470.  
  471.  The prime difference between SQL, Viewer and Chart objects is that they have a 
  472.  different Primary View on to the object. It is quite possible to store what 
  473.  are in effect identical objects as SQL, Viewer and Chart objects.  When these 
  474.  objects are selected at a later date it is the type of object that will 
  475.  determine how XY-Query is invoked. 
  476.  
  477.  SQL objects are displayed with the SQL window as the Primary View.  Viewer 
  478.  objects have the Viewer as the Primary View and Chart objects have the Chart 
  479.  window as their Primary View. 
  480.  
  481.  For an SQL object, the SQL window is displayed and you decide whether or not 
  482.  to run the query and show the Viewer and Chart. For a Viewer object, XY-Query 
  483.  runs the query automatically and displays the Viewer window. You can move from 
  484.  this window to the other windows to view the query or to plot a chart. In the 
  485.  final case for a Chart object, once again the query runs automatically and 
  486.  displays the Chart window. Again, from here you can display the SQL and Viewer 
  487.  windows. 
  488.  
  489.  The object is closed only when the primary window is closed. 
  490.  
  491.  Note that any data displayed is not retained when you close Viewer and Chart 
  492.  objects. Only the query in the SQL editor and the presentation styles and 
  493.  settings for the object's three available windows are saved with the object. 
  494.  
  495.  Procedure objects cause the XY-Query Procedure window to be shown and it is 
  496.  from this window that XY-Query Procedures can be constructed and executed. 
  497.  There is however one exception to this. This is when a Procedure object has 
  498.  been saved with an Invocation mode of Background. When the object is opened 
  499.  the procedure starts automatically but the window is not shown. 
  500.  
  501.  Procedures also do not retain any data when closed but do retain the content 
  502.  of the Procedure text together with all presentation styles and settings for 
  503.  the Procedure window. 
  504.  
  505.  
  506. ΓòÉΓòÉΓòÉ 6.2. Untitled Objects ΓòÉΓòÉΓòÉ
  507.  
  508. Untitled XY-Query objects are only temporary and do not exist once the instance 
  509. of XY-Query has been closed. 
  510.  
  511. You instantiate an untitled Sql object whenever you open XY-Query from the 
  512. program icon in its desktop folder, or when you select the New option from the 
  513. File menu on an Sql window or if you start XY-Query from the command line 
  514. without naming an existing object. 
  515.  
  516. Untitled Procedure objects can only be instantiated from either the command 
  517. line or from the New option fromt he File menu on the Procedure window. 
  518.  
  519. The main purpose of untitled objects is to allow you to allow you to start an 
  520. XY-Query instance without first having to create an object from a template. It 
  521. allows you, for example to run ad-hoc queries or procedures which you do not 
  522. wish to keep after the instance has been closed. It is also one of the prime 
  523. ways in which you can develop your permanent objects. You can create the query 
  524. or procedure from an untitled object and once you are satisfied with it all you 
  525. have to do is Copy-To a permanent object. 
  526.  
  527. As these objects are transient there is no associated object file and therefore 
  528. there is no concept of saving the object. You can of course create another 
  529. permanent object by using Copy-To as described above. 
  530.  
  531.  
  532. ΓòÉΓòÉΓòÉ 6.3. Object security ΓòÉΓòÉΓòÉ
  533.  
  534. There are two levels of security that can be applied to XY-Query objects that 
  535. you create. These are: 
  536.  
  537.       Write Protection 
  538.       Read Protection 
  539.  
  540.  Setting Write protection on an object will prevent changes made to the object 
  541.  from being saved back to the object file. 
  542.  
  543.  Read protection will prevent unauthorised users from opening specific objects. 
  544.  Read protected objects are encrypted and will not open unless the correct 
  545.  password is given. 
  546.  
  547.  Both levels of protection rely on the use of passwords. An object can have a 
  548.  read and a write protect password. It may be that they are both the same but 
  549.  they do not need to be. It is up to the creator of the object to determine 
  550.  what level of security it requires and what the passwords should be. 
  551.  
  552.  Each security option requires a password to be set and made active. For Write 
  553.  protection once a password is set the protection is not automatically active 
  554.  (if it was you wouldn't be able to save the fact that it was set). Rather, the 
  555.  password is marked as set, but inactive until you save or close the object. 
  556.  Once you save the object the write protection password then becomes active for 
  557.  you and all other users of the object. This object can not then be saved again 
  558.  without de-activating the write protection password. 
  559.  
  560.  In the case of read protection, once a password has been set it is 
  561.  automatically made active. Once the object has been saved it will be encrypted 
  562.  and all future users will be asked for the read password to when opening the 
  563.  object. 
  564.  
  565.  There is an exception however for read protection when it is set for an object 
  566.  that already has active Write protection. The Write protection means that no 
  567.  information will be written to the object while it is active. This means that 
  568.  not even the fact that Read protection has been set can be written. To ensure 
  569.  that the Read protection is acknowledged it is necessary for you to 
  570.  de-activate the write protection on the object. Subsequently saving or closing 
  571.  the object will save the Read protection and also set write protection active 
  572.  again. 
  573.  
  574.  Similarly, you cannot remove Read protection from a write protected object 
  575.  unless you first temorarily de-activate write protection and then save or 
  576.  close the object. 
  577.  
  578.  The last Read password that you enter is remembered by XY-Query. If the next 
  579.  read-protected object you open has the same password then XY-Query will not 
  580.  prompt you to enter it and will carry on and open the object. If you wish to 
  581.  remove the last Read password you entered from XY-Query you should select the 
  582.  Logoff Object option from the Sessions utility sub-menu on an Sql, Viewer or 
  583.  Chart window. 
  584.  
  585.  The setting of the security levels and associated passwords is done from the 
  586.  Security page of the Sql or Procedure window settings, see Security page. 
  587.  
  588.  Note:  All passwords are case sensitive and retain any leading or trailing 
  589.  spaces. 
  590.  
  591.  
  592. ΓòÉΓòÉΓòÉ 7. Opening and closing XY-Query ΓòÉΓòÉΓòÉ
  593.  
  594.  
  595. ΓòÉΓòÉΓòÉ 7.1. Opening XY-Query ΓòÉΓòÉΓòÉ
  596.  
  597. XY-Query can be opened in a number of different ways. If you want to start a 
  598. new XY-Query SQL session then you start the application in one of two ways: 
  599.  
  600.      Issue this command from an OS/2 command line: 
  601.  
  602.                  XYQUERY
  603.  
  604.      Open the XY-Query program icon in the desktop folder. 
  605.  
  606.  Both of these actions open a new untitled SQL object that inherits all of the 
  607.  defaults set in the XY-Query Settings facility. 
  608.  
  609.  If you want a new XY-Query Procedure session, issue this command from an OS/2 
  610.  command line: 
  611.  
  612.        XYQUERY /P
  613.  to open a new untitled Procedure object that inherits all the relevant 
  614.  defaults set in the XY-Query Settings facility. 
  615.  
  616.  Another way of starting an XY-Query session is to use the object templates 
  617.  provided at installation to start a new XY-Query session: 
  618.  
  619.    1. Open the Work folder. 
  620.    2. Open the Template folder. 
  621.    3. Drag a copy of the relevant XY-Query object template from the Template 
  622.       folder to the Work folder. 
  623.    4. Rename the copied object as required. 
  624.    5. Open the new object and obtain a window corresponding to the type of 
  625.       object opened. 
  626.  
  627.  Note:  For new Viewer or Chart objects, the initial window appears to be 
  628.  empty. This is because there has been no query defined which could be run to 
  629.  provide the data to fill the Viewer or against which to plot a chart. In these 
  630.  cases the SQL window will also be displayed from where you can define your 
  631.  query. 
  632.  
  633.  You can also open XY-Query from an existing object. Do one of the following: 
  634.  
  635.      Issue this command from an OS/2 command line: 
  636.  
  637.                  XYQUERY obj_name
  638.       where obj_name is the potentially fully qualified name of the object to 
  639.       be opened 
  640.      Open the object from within a folder on the OS/2 desktop. 
  641.  
  642.  Note:  If your computer uses the File Allocation Table (FAT) system of storing 
  643.  files, only eight-character names are supported for objects. You can still 
  644.  give them names of more than eight characters, but OS/2 automatically 
  645.  truncates the name. 
  646.  
  647.  
  648. ΓòÉΓòÉΓòÉ 7.2. Closing XY-Query ΓòÉΓòÉΓòÉ
  649.  
  650. For SQL, Viewer or Chart objects, when you close the primary window of the 
  651. object you also close XY-Query, automatically closing any other windows open 
  652. for the object.  You can close XY-Query while a query is still executing but 
  653. XY-Query requests further confirmation from you before it shuts down. 
  654.  
  655. For Procedure objects you need to close only the Procedure window to leave 
  656. XY-Query. 
  657.  
  658.  
  659. ΓòÉΓòÉΓòÉ 8. XY-Query windows ΓòÉΓòÉΓòÉ
  660.  
  661.  
  662. ΓòÉΓòÉΓòÉ 8.1. Introduction ΓòÉΓòÉΓòÉ
  663.  
  664. This chapter introduces the four XY-Query windows and details the facilities 
  665. available from each. 
  666.  
  667.  
  668. ΓòÉΓòÉΓòÉ 8.2. SQL window ΓòÉΓòÉΓòÉ
  669.  
  670.  
  671. ΓòÉΓòÉΓòÉ 8.2.1. Purpose ΓòÉΓòÉΓòÉ
  672.  
  673. The primary function of the SQL Window is to enable the definition, display and 
  674. execution of SQL queries. 
  675.  
  676. Note:  For more detailed descriptions of SQL window facilities, see chapter 
  677. Working with the SQL window and section SQL window settings. 
  678.  
  679.  
  680. ΓòÉΓòÉΓòÉ 8.2.2. Appearance ΓòÉΓòÉΓòÉ
  681.  
  682. The SQL window is constructed of a number of elements: 
  683.  
  684.  Element           Description 
  685.  Title Bar         Shows name of current object and the window type i.e. SQL. 
  686.  Menu Bar          Details all menus of facilities available from the SQL 
  687.                    window. 
  688.  Toolbar           Used to provide you with fast path access to commonly used 
  689.                    functions. 
  690.  SQL Query Area    Area which you can use to construct SQL queries. The 
  691.                    appearance of this area can change dependant upon the view 
  692.                    and mode you choose. 
  693.  Information Bar   Used to display status and information messages to you. 
  694.  
  695.  
  696. ΓòÉΓòÉΓòÉ 8.2.3. Views and modes ΓòÉΓòÉΓòÉ
  697.  
  698. There are two distinct views which determine the appearance of the query area 
  699. of the SQL window. 
  700.  
  701.      Edit SQL View (XY-Query SQL window - Edit SQL view) 
  702.      Builder View (XY-Query SQL window - Builder view (Locations page)) 
  703.  
  704.  You can place the SQL window in either of two modes. These are Browse and 
  705.  Update. 
  706.  
  707.  In Browse mode the Sql editor and location selector, or the Builder pages 
  708.  (depending on the current view) are made read only. 
  709.  
  710.  You can set the default view in which the SQL window is displayed for any new 
  711.  XY-Query objects from the View page in the SQL section of the XY-Query 
  712.  Settings facility, see SQL Settings - View page. 
  713.  
  714.  
  715. ΓòÉΓòÉΓòÉ 8.2.3.1. Edit Sql View ΓòÉΓòÉΓòÉ
  716.  
  717. XY-Query SQL window - Edit SQL view 
  718.  
  719. If the window is in its Edit SQL view, the query area is made up of two 
  720. elements. 
  721.  
  722.      Location selector 
  723.  
  724.      Sql editor 
  725.  
  726.  The Location selector allows you to select the location which contains the 
  727.  table or tables against which a query can be executed. 
  728.  
  729.  When a location is selected XY-Query automatically connects to it, prompting 
  730.  for logon information as appropriate. If you do not have have a suitably 
  731.  authorised userid and password for the location, consult your system 
  732.  administrator. 
  733.  
  734.  By connecting to the database at this time, you remove the overhead of 
  735.  connection when the query is run. 
  736.  
  737.  The main part of the window (the text area) is termed the Sql editor and is 
  738.  used for displaying and editing an SQL query. 
  739.  
  740.  
  741. ΓòÉΓòÉΓòÉ 8.2.3.2. Builder View ΓòÉΓòÉΓòÉ
  742.  
  743. XY-Query SQL window - Builder view (Locations page) 
  744.  
  745. In Builder view you use a series of panels to define and build an SQL query 
  746. automatically which can then be run against tables you have selected. With this 
  747. view you can create a query, execute it and see the results without having to 
  748. have see any actual SQL statements. The Query Builder facility is explained 
  749. more fully later in this guide, see Using the Query Builder. 
  750.  
  751.  
  752. ΓòÉΓòÉΓòÉ 8.2.4. SQL window - File menu ΓòÉΓòÉΓòÉ
  753.  
  754. The File menu contains the following options. 
  755.  
  756.  New            Use this to open a new 'Untitled' XY-Query SQL session. It has 
  757.                 no link to the object from which it was spawned and is 
  758.                 initialised with the relevant default attributes from the 
  759.                 Settings facility. 
  760.  Save           Use this to save the current state of the object. It not only 
  761.                 saves the SQL window attributes but also the attributes of the 
  762.                 other windows associated with the object. If the object is 
  763.                 'Untitled' then save can not be actioned directly but does 
  764.                 invoke the 'Copy To' facility described below to create a new 
  765.                 object with all of the attributes of the current object. 
  766.  Copy To        Use this to create a new object identical to the current state 
  767.                 of the object. 
  768.  Print          Use this to print the contents of the Sql editor to a selected 
  769.                 printer. If the window is currently in Builder view, the SQL 
  770.                 query defined so far will be constructed and printed. 
  771.  Quit           Use this to close XY-Query without saving any of the current 
  772.                 settings. This option is only available if the SQL window is 
  773.                 the Primary View. 
  774.  
  775.  
  776. ΓòÉΓòÉΓòÉ 8.2.5. SQL window - Edit menu ΓòÉΓòÉΓòÉ
  777.  
  778. The Edit menu contains the following options. 
  779.  
  780.  Select All     Use this to mark (highlight) all of the text in the Sql editor. 
  781.  Deselect All   Use this to de-highlight any marked text in the Sql editor. 
  782.  Cut            Use this to move any marked text to the clipboard. The marked 
  783.                 text is deleted from the Sql editor. 
  784.  Copy           Use this to copy any marked text to the clipboard. The marked 
  785.                 text is left unchanged. 
  786.  Paste          Use this to paste the contents of the clipboard into the Sql 
  787.                 editor at the current cursor position. 
  788.  Clear          Use this to remove all text from the Sql editor. 
  789.  
  790.  
  791. ΓòÉΓòÉΓòÉ 8.2.6. SQL window - Query menu ΓòÉΓòÉΓòÉ
  792.  
  793. The Query menu contains the following options. 
  794.  
  795.  Run            Use this to start the execution of an SQL query defined in the 
  796.                 Builder or in the Sql editor. 
  797.  Stop           Use this to request that the currently executing SQL query is 
  798.                 stopped. 
  799.  Models         Use this to show a list of popular SQL commands. Selecting one 
  800.                 gives an example of the syntax for that command. 
  801.  History        Use these options to traverse through, add to, or remove 
  802.                 queries from the History ring. 
  803.  Import         Use this to import a query from outside of the current XY-Query 
  804.                 environment. This includes other file formats as well as Query 
  805.                 Manager, QMF and XDB queries. 
  806.  Export         Use this to export the query to one of a number of other file 
  807.                 formats. 
  808.  
  809.  
  810. ΓòÉΓòÉΓòÉ 8.2.7. SQL window - View menu ΓòÉΓòÉΓòÉ
  811.  
  812. The View menu contains the following options. 
  813.  
  814.  Open Settings    Use this to open the SQL window settings notebook from where 
  815.                   SQL window settings can be changed. 
  816.  Edit SQL         Use this to switch the SQL window into its Edit SQL view. 
  817.  Builder          Use this to switch the SQL window into its Builder view. 
  818.  Builder Pages    Use the options under this menu to move sequentially, or 
  819.                   selectively through the pages of the builder. 
  820.  Browse           Use this option to set the Sql editor to read only mode. 
  821.  Update           Use this option to set the Sql editor to read / write mode. 
  822.  Toolbar          Use this option to show or suppress the toolbar on the SQL 
  823.                   window. 
  824.  Information Bar  Use this option to show or suppress the Information bar on 
  825.                   the SQL window. 
  826.  
  827.  
  828. ΓòÉΓòÉΓòÉ 8.2.8. SQL window - Window menu ΓòÉΓòÉΓòÉ
  829.  
  830. The Window menu contains the following options. 
  831.  
  832.  Viewer         Use this to show the Viewer. If the query has not previously 
  833.                 been run then it causes the query to execute. 
  834.  Chart          Use this to show the Chart window. If the query has not 
  835.                 previously been run then it causes the query to execute. 
  836.  
  837.  
  838. ΓòÉΓòÉΓòÉ 8.2.9. SQL window - Utilities menu ΓòÉΓòÉΓòÉ
  839.  
  840. The Utilities menu has the following options: 
  841.  
  842.  Database       Use this to create or erase DB2/2 databases. 
  843.  Table          Use this to define, alter the definition of, create, append to, 
  844.                 or erase tables. 
  845.  Sessions       Use this to register logons to be used when XY-Query connects 
  846.                 to various locations. 
  847.  
  848.  
  849. ΓòÉΓòÉΓòÉ 8.2.10. SQL window - Help menu ΓòÉΓòÉΓòÉ
  850.  
  851. The Help menu enables various types of help to be invoked for the application. 
  852.  
  853.  General Help          Use this to display general help for the SQL window. 
  854.  Keys Help             Use this to display help explaining which key 
  855.                        combinations can be used to perform actions within the 
  856.                        SQL window. 
  857.  Builder Help          Use this to display help for the currently displayed 
  858.                        Builder page. 
  859.  Product Information   Use this to display the XY-Query about box. 
  860.  
  861.  
  862. ΓòÉΓòÉΓòÉ 8.2.11. SQL window - toolbar ΓòÉΓòÉΓòÉ
  863.  
  864. Underneath the menu bar is a toolbar.  Use the Toolbar item in the View menu to 
  865. suppress or restore the toolbar.  The toolbar provides a quick way of 
  866. performing commonly required actions.  Pressing the appropriate button invokes 
  867. the function required. 
  868.  
  869.        Save current object 
  870.        Copy to a new object 
  871.        Print query 
  872.        Show SQL window settings 
  873.        Run query 
  874.        Halt execution of query 
  875.        Place the SQL window in its Builder view 
  876.        Place the SQL window in its Edit SQL view 
  877.        Move backwards through History Ring 
  878.        Move forwards through History Ring 
  879.        Switch to Viewer 
  880.        Switch to Chart window 
  881.        Get help 
  882.  
  883.  Note:  The History Ring (forwards and backwards) buttons are visible only if 
  884.  the Ring has been initialised. 
  885.  
  886.  
  887. ΓòÉΓòÉΓòÉ 8.2.12. SQL window - information bar ΓòÉΓòÉΓòÉ
  888.  
  889. XY-Query uses the Information Bar at the bottom of the window to give status 
  890. and error messages. It can be shown or suppressed by selecting or de-selecting 
  891. the relevant option in the View menu. 
  892.  
  893. When the Information Bar is not visible you will be unaware of normal status 
  894. messages but error messages will be displayed to you via message boxes. 
  895.  
  896. For long messages the Information Bar must be expanded to see the full text. Do 
  897. this by pressing the button at the extreme right of the bar, or by using the 
  898. key combination of Ctrl and I. 
  899.  
  900. Note:  Information Bars, identical functionally to the one described here, 
  901. appear on all of the main XY-Query windows. 
  902.  
  903.  
  904. ΓòÉΓòÉΓòÉ 8.3. Viewer ΓòÉΓòÉΓòÉ
  905.  
  906.  
  907. ΓòÉΓòÉΓòÉ 8.3.1. Purpose ΓòÉΓòÉΓòÉ
  908.  
  909. The primary function of the Viewer is to display and format the data returned 
  910. from a database after a query has been executed. 
  911.  
  912. For more detailed descriptions of the facilities available from the Viewer 
  913. window, see chapter Working with the Viewer window and section Viewer window 
  914. settings. 
  915.  
  916.  
  917. ΓòÉΓòÉΓòÉ 8.3.2. Appearance ΓòÉΓòÉΓòÉ
  918.  
  919. The Viewer is constructed of a number of elements: 
  920.  
  921.  Element         Description 
  922.  Title Bar       Shows name of current object and the window type i.e. VIEWER. 
  923.  Menu Bar        Details all menus available from the Viewer. 
  924.  Toolbar         Used to provide fast path access to commonly used functions. 
  925.  Display Area    Area which is used to display the data returned by the query. 
  926.                  The content and appearance of this depends upon the view and 
  927.                  mode you have chosen and the formatting performed. 
  928.  Information Bar Used to display status and information messages to you. 
  929.  
  930.  
  931. ΓòÉΓòÉΓòÉ 8.3.3. Views and Modes ΓòÉΓòÉΓòÉ
  932.  
  933. There are two distinct views which determine the appearance of the display area 
  934. of the Viewer window. 
  935.  
  936.      Report View 
  937.      Form View 
  938.  
  939.  You can place the Viewer, in either view, in two modes, Browse and Update. The 
  940.  mode setting decides whether you can dynamically edit the text and data 
  941.  displayed in the Viewer. 
  942.  
  943.  The default view and mode in which the Viewer is displayed for any new 
  944.  XY-Query objects is defined on the View page in the Viewer section of the 
  945.  XY-Query Settings facility, see Viewer Settings - View page. 
  946.  
  947.  
  948. ΓòÉΓòÉΓòÉ 8.3.4. Report View ΓòÉΓòÉΓòÉ
  949.  
  950. XY-Query Viewer window (Report view - Browse mode) 
  951.  
  952. XY-Query Viewer window (Report view - Update mode) 
  953.  
  954. The report view displays the data together with any heading and footing lines 
  955. that have been added in one continuous report. In browse mode the report view 
  956. is displayed as a plain paper report where any repeated data within a 
  957. summarised group is not shown. However, in update mode the report view is 
  958. displayed in a cellular form with each element (heading, column title, data 
  959. item and footing) selectable and, potentially, directly editable. The element 
  960. currently with the focus will be displayed with an edit box around it. Its 
  961. contents can be changed by manually overtyping. 
  962.  
  963. Note:  The data can only be directly edited if the Data Update setting in the 
  964. Viewer settings notebook allows it. 
  965.  
  966.  
  967. ΓòÉΓòÉΓòÉ 8.3.5. Form View ΓòÉΓòÉΓòÉ
  968.  
  969. XY-Query Viewer window (Form View) 
  970.  
  971. The Form view enables row-by-row analysis of the report displayed in the 
  972. Viewer. The data it displays will depend on the type of report defined in the 
  973. Report view. If it is a straightforward data only report then the data rows 
  974. will be displayed. If the report is enhanced with breaks and aggregation usages 
  975. to give total line these will NOT be displayed under Form view. 
  976.  
  977. If a summary report is currently defined such as a Group report, an Across 
  978. report or a Totals Only report, then Form view will display the summary data 
  979. rows individually, again missing out any total rows that may shown in Report 
  980. view. 
  981.  
  982. Essentially, only the rows in Report view that are displayed in data format 
  983. will be seen under Form view. 
  984.  
  985. When Form view is in browse mode the data is not updateable, When it is in 
  986. update mode the data is editable only if the Data Update setting in the Viewers 
  987. settings notebook allows it and it is displaying non-summarised data. 
  988.  
  989. Note:  Headings and footings are not visible in this view and column titles can 
  990. not be changed. 
  991.  
  992. A data row is displayed as a set of fields which, providing the data is 
  993. editable, can be changed. 
  994.  
  995. The data is displayed with the same settings as used in Report View. 
  996.  
  997. Text fields will have a button to their right. When pressed this will expand 
  998. the entry field to multiple lines to allow free format text. Note that the 
  999. column in the table may not allow free format text so care should be taken when 
  1000. using this feature. 
  1001.  
  1002. The toolbar on the Form view provides a quick way of performing some of the 
  1003. most popular actions required.  Pressing the appropriate button invokes the 
  1004. function required. 
  1005.  
  1006. The items available on the Form view toolbar are as follows: 
  1007.  
  1008.        Display first data row 
  1009.        Display previous data row 
  1010.        Display next data row 
  1011.        Display last data row 
  1012.        Insert a new blank data row after the current row 
  1013.        Duplicate the current data row after itself 
  1014.        Delete the current data row 
  1015.        Display general help for the Form View 
  1016.  
  1017.  
  1018. ΓòÉΓòÉΓòÉ 8.3.6. Viewer window - regions ΓòÉΓòÉΓòÉ
  1019.  
  1020. The data display area is made up of different regions. These regions are 
  1021. defined such that the presentation of the window can be tailored by setting 
  1022. their individual style attributes. This tailoring is done via the Viewer window 
  1023. settings notebook. The regions and the elements of the report they cover are 
  1024. described below. 
  1025.  
  1026.  Region          Description 
  1027.  Data            The elements of data returned from the database 
  1028.  Column Titles   The names of the columns 
  1029.  Headings        Text added to provide headings for the report 
  1030.  Footings        Text added to provide footings for the report 
  1031.  Background      The background of the report 
  1032.  Totals          Calculated totals. 
  1033.  Selected        Any data that is temporarily marked (highlighted). 
  1034.  Search Target   Data that matches a search request 
  1035.  Lines           The grid lines and underlines that are drawn in the Viewer 
  1036.                  when it is in Report view. 
  1037.  Buttons         The selection buttons on the Viewer in Report view and update 
  1038.                  mode. 
  1039.  Update          The text in the cell with the edit focus and the focus box. 
  1040.  
  1041.  
  1042. ΓòÉΓòÉΓòÉ 8.3.7. Viewer window - File menu ΓòÉΓòÉΓòÉ
  1043.  
  1044. The File menu contains the following options. 
  1045.  
  1046.  Save      Use this to save the current state of the object. It not only saves 
  1047.            the Viewer window attributes but also the attributes of the other 
  1048.            windows associated with the object. If the object is 'Untitled' then 
  1049.            save can not be actioned directly but does invoke the 'Copy To' 
  1050.            facility described below to create a new object with all of the 
  1051.            attributes of the current object. 
  1052.  Copy To   Use this to create a new object identical to the current state of 
  1053.            the object. 
  1054.  Print     Use this to print to contents of the Viewer data area to a selected 
  1055.            printer. 
  1056.  Quit      Use this to close XY-Query without saving any of the current 
  1057.            settings. This option is only available if the Viewer is the Primary 
  1058.            View. 
  1059.  
  1060.  
  1061. ΓòÉΓòÉΓòÉ 8.3.8. Viewer window - Edit menu ΓòÉΓòÉΓòÉ
  1062.  
  1063. The Edit menu contains the following options. 
  1064.  
  1065.  Select All              Use this to mark (highlight) all of the data in the 
  1066.                          Viewer in Report view. 
  1067.  Deselect All            Use this to de-highlight all marked items in the 
  1068.                          Viewer. 
  1069.  Cut                     Use this to move any marked text to the clipboard. The 
  1070.                          original text is deleted. 
  1071.  Copy                    Use this to copy any marked text to the clipboard. The 
  1072.                          marked text is left unchanged. 
  1073.  Paste                   Use this to insert text from the clipboard into the 
  1074.                          Viewer 
  1075.  Find                    Use this to invoke the Find facility which can be used 
  1076.                          to search for occurrences of certain characters in the 
  1077.                          Viewer. 
  1078.  Find Next               Use this to perform a repeat find operation. 
  1079.  Apply Pending Changes   Issue all pending table update requests. Once this is 
  1080.                          selected the changes cannot be undone, unless they are 
  1081.                          rejected from the database. 
  1082.  Undo                    Undo the current change (i.e. restore the text in the 
  1083.                          current edit box to its original value before the edit 
  1084.                          was started) or undo all unapplied (pending) data 
  1085.                          changes. 
  1086.  Insert Row              Add an empty row of the same type as the row with 
  1087.                          focus, directly after this row. Heading, footing and 
  1088.                          data rows can be inserted. 
  1089.  Duplicate Row           Duplicate the row with focus directly after it in the 
  1090.                          report. Headings, footings and data rows can be 
  1091.                          duplicated. 
  1092.  Delete Row              This will delete the current row from the report. 
  1093.                          Heading, footing and data rows can be deleted. 
  1094.  Insert Row Before       Add an empty row of the same type as the row with 
  1095.                          focus, directly before this row. Heading, footing and 
  1096.                          data rows can be inserted. 
  1097.  Duplicate Row Before    Duplicate the row with focus directly before it in the 
  1098.                          report. Headings, footings and data rows can be 
  1099.                          duplicated. 
  1100.  First                   Place Form View at first data row of report 
  1101.  Backward                Move backward one row (in Form View) 
  1102.  Forward                 Move forward one row (in Form View) 
  1103.  Last                    Place Form View at last data row of report 
  1104.  
  1105.  
  1106. ΓòÉΓòÉΓòÉ 8.3.9. Viewer window - Viewer menu ΓòÉΓòÉΓòÉ
  1107.  
  1108. The Viewer menu contains the following options. 
  1109.  
  1110.  Autorefresh   Use this to run the query repeatedly. The delay between the 
  1111.                query finishing and it being re-started is set in the Timings 
  1112.                page of the XY-Query Settings facility. The query continues to 
  1113.                re-run until auto-refresh is switched off. 
  1114.  Refresh now   Use this to run the query again once, thus causing the data in 
  1115.                the Viewer to be refreshed. 
  1116.  Stop          Use this to stop the currently executing query. 
  1117.  Export        Use this to export the data in the Viewer to a file in one of a 
  1118.                number of industry standard and popular file formats. 
  1119.  
  1120.  
  1121. ΓòÉΓòÉΓòÉ 8.3.10. Viewer window - Selected menu ΓòÉΓòÉΓòÉ
  1122.  
  1123. The Selected menu has one option, Plot To Chart, which, when invoked, causes a 
  1124. chart to be plotted that takes into account only the data that is marked in the 
  1125. data area of the Viewer. 
  1126.  
  1127. Note:  This option is not available if only non-numeric data is marked. 
  1128.  
  1129.  
  1130. ΓòÉΓòÉΓòÉ 8.3.11. Viewer Window - View menu ΓòÉΓòÉΓòÉ
  1131.  
  1132. The View menu contains the following options. 
  1133.  
  1134.  Open Settings    Use this to open the Viewer window settings notebook from 
  1135.                   where the appearance and contents of the Viewer can be 
  1136.                   tailored. 
  1137.  Subset Columns   Use this to open the Viewer window settings notebook at the 
  1138.                   Subset columns page. 
  1139.  Fix Columns      Use this to open the Viewer window settings notebook at the 
  1140.                   Fix columns page. 
  1141.  Break Columns    Use this to open the Viewer window settings notebook at the 
  1142.                   Break columns page. 
  1143.  Headings         Use this to open the Viewer window settings notebook at the 
  1144.                   Headings page. 
  1145.  Footings         Use this to open the Viewer window settings notebook at the 
  1146.                   Footings page. 
  1147.  Report           Use this option to display the Viewer in Report view. 
  1148.  Form             Use this option to display the Viewer in Form view. 
  1149.  Browse           Use this to set the Viewer to browse mode 
  1150.  Update           Use this to set the Viewer to update mode 
  1151.  Toolbar          Use this option to show or suppress the toolbar on the 
  1152.                   Viewer. 
  1153.  Information Bar  Use this option to show or suppress the Information bar on 
  1154.                   the Viewer. 
  1155.  
  1156.  
  1157. ΓòÉΓòÉΓòÉ 8.3.12. Viewer window - Window menu ΓòÉΓòÉΓòÉ
  1158.  
  1159. The Window menu contains the following options. 
  1160.  
  1161.  Chart          Use this to show the Chart window. 
  1162.  SQL            Use this to show the SQL window. 
  1163.  
  1164.  
  1165. ΓòÉΓòÉΓòÉ 8.3.13. Viewer window - Utilities menu ΓòÉΓòÉΓòÉ
  1166.  
  1167. The Utilities menu has the following options: 
  1168.  
  1169.  Database       Use this to create or erase DB2/2 databases. 
  1170.  Table          Use this to define, alter the definition of, create, append to, 
  1171.                 or erase tables. 
  1172.  Sessions       Use this to register logons to be used when XY-Query connects 
  1173.                 to various databases. 
  1174.  
  1175.  
  1176. ΓòÉΓòÉΓòÉ 8.3.14. Viewer window - Help menu ΓòÉΓòÉΓòÉ
  1177.  
  1178. The Help menu enables various types of help to be invoked for the application. 
  1179.  
  1180.  General Help          Use this to display general help for the Viewer. 
  1181.  Keys Help             Use this to display help explaining which key 
  1182.                        combinations can be used to perform actions within the 
  1183.                        Viewer window. 
  1184.  Form View Help        Use this to display specific help for Form View. 
  1185.  Product Information   Use this to display the XY-Query about box. 
  1186.  
  1187.  
  1188. ΓòÉΓòÉΓòÉ 8.3.15. Viewer window - toolbar ΓòÉΓòÉΓòÉ
  1189.  
  1190. The toolbar provides a quick way of performing commonly required actions. 
  1191. Pressing the appropriate button invokes the function required. 
  1192.  
  1193. The items available on the Viewer toolbar are as follows: 
  1194.  
  1195.        Save current object 
  1196.        Copy to a new object 
  1197.        Print Viewer data 
  1198.        Show Viewer window settings 
  1199.        Select columns to display 
  1200.        Search for text 
  1201.        Find next occurrence of search string 
  1202.        Apply pending table updates 
  1203.        Set Viewer to its Report view 
  1204.        Set Viewer to its Form view 
  1205.        Set Viewer to its Browse mode 
  1206.        Set Viewer to its Update mode 
  1207.        Switch to Chart window 
  1208.        Switch to SQL window 
  1209.        Display general help for Viewer 
  1210.  
  1211.  
  1212. ΓòÉΓòÉΓòÉ 8.4. Chart window ΓòÉΓòÉΓòÉ
  1213.  
  1214.  
  1215. ΓòÉΓòÉΓòÉ 8.4.1. Purpose ΓòÉΓòÉΓòÉ
  1216.  
  1217. The primary function of the Chart Window is to display, graphically, the data 
  1218. returned after a query has been executed. 
  1219.  
  1220. For more detailed descriptions of the functions available from the Chart window 
  1221. see Working with the Chart window and Chart window settings. 
  1222.  
  1223.  
  1224. ΓòÉΓòÉΓòÉ 8.4.2. Appearance ΓòÉΓòÉΓòÉ
  1225.  
  1226. The Chart window is constructed of a number of elements: 
  1227.  
  1228.  Element           Description 
  1229.  Title Bar         Shows name of current object and the window type i.e. CHART. 
  1230.  Menu Bar          Details all menus of facilities available from the Chart 
  1231.                    window. 
  1232.  Toolbar           Used to provide you with fast path access to commonly used 
  1233.                    functions. 
  1234.  Plot Area         Area which is used to display a chart. 
  1235.  Information Bar   Used to provide status and information messages to you. 
  1236.  
  1237.  
  1238. ΓòÉΓòÉΓòÉ 8.4.3. Views ΓòÉΓòÉΓòÉ
  1239.  
  1240. There are five different chart types that can be displayed in the Plot area of 
  1241. the Chart window. 
  1242.  
  1243.      Bar Chart 
  1244.      Pie Chart 
  1245.      Area Chart 
  1246.      Line Chart 
  1247.      High-Low-Close Chart 
  1248.  
  1249.  XY-Query Chart window (3D bar chart) 
  1250.  
  1251.  XY-Query Chart window (line chart) 
  1252.  
  1253.  XY-Query Chart window (pie chart) 
  1254.  
  1255.  You can tailor the appearance of the chart to suit your requirements. 
  1256.  
  1257.  
  1258. ΓòÉΓòÉΓòÉ 8.4.4. Chart window - regions ΓòÉΓòÉΓòÉ
  1259.  
  1260. The plot area in which the chart is displayed is made up of different regions. 
  1261. These regions are individually tailorable and have their own style settings to 
  1262. enable the chart to be manipulated to your exact requirements. This tailoring 
  1263. is done via the Chart window settings notebook. 
  1264.  
  1265. The regions and the parts of the plot area they cover are described below. 
  1266.  
  1267.  Region          Description 
  1268.  Chart           The chart which is plotted according to the data specified 
  1269.  Titles          Main chart and pie chart titles together with titles for all 
  1270.                  axes. 
  1271.  Data Labels     Labels attached to the chart giving details of the values 
  1272.                  plotted 
  1273.  Legend          Key to match values plotted in the chart to data items 
  1274.  Axes            The X , Y and Y2 axes against which charts are plotted 
  1275.  Background      The background of the plot area. 
  1276.  
  1277.  
  1278. ΓòÉΓòÉΓòÉ 8.4.5. Chart window - File menu ΓòÉΓòÉΓòÉ
  1279.  
  1280. The File menu contains the following options. 
  1281.  
  1282.  Save      Use this to save the current state of the object. It not only saves 
  1283.            the Chart window attributes but also the attributes of the other 
  1284.            windows associated with the object. If the object is 'Untitled' then 
  1285.            save can not be actioned directly but does invoke the 'Copy To' 
  1286.            facility described below to create a new object with all of the 
  1287.            attributes of the current object. 
  1288.  Copy To   Use this to create a new object identical to the current state of 
  1289.            the object. 
  1290.  Print     Use this to print the current chart to a selected printer. 
  1291.  Quit      Use this to close XY-Query without saving any of the current 
  1292.            settings. This option is only available if the Chart window is the 
  1293.            Primary View. 
  1294.  
  1295.  
  1296. ΓòÉΓòÉΓòÉ 8.4.6. Chart window - Edit menu ΓòÉΓòÉΓòÉ
  1297.  
  1298. The Edit menu has one option, Copy, which causes the current chart to be copied 
  1299. to the OS/2 clipboard. It is copied to the clipboard in Metafile and Bitmap 
  1300. formats. 
  1301.  
  1302.  
  1303. ΓòÉΓòÉΓòÉ 8.4.7. Chart window - Chart menu ΓòÉΓòÉΓòÉ
  1304.  
  1305. The Chart menu contains the following options. 
  1306.  
  1307.  Auto-refresh   Use this to run the query repeatedly. The delay between the 
  1308.                 query finishing and it being re-started is set in the Timings 
  1309.                 page of the XY-Query Settings facility. The query continues to 
  1310.                 re-run until auto-refresh is switched off. Every time the query 
  1311.                 is re-run the chart is re-plotted. 
  1312.  Refresh now    Use this to run the query again once, thus causing the chart to 
  1313.                 be re-plotted. 
  1314.  Stop           Use this to stop the currently executing query. 
  1315.  Export         Use this to export the current chart as a bitmap file (.BMP) or 
  1316.                 as a metafile (.MET) 
  1317.  
  1318.  
  1319. ΓòÉΓòÉΓòÉ 8.4.8. Chart window - View menu ΓòÉΓòÉΓòÉ
  1320.  
  1321. The View menu contains the following options. 
  1322.  
  1323.  Open Settings            Use this to open the Chart window settings notebook 
  1324.                           from where the appearance and contents of the Chart 
  1325.                           window can be tailored. 
  1326.  Subset Columns and Rows  Use this to open the Chart window settings notebook 
  1327.                           at the Subset page. From there the data elements to 
  1328.                           use for the X and Y axes can be specified together 
  1329.                           with the subset of the rows of data returned from the 
  1330.                           query which are to be plotted. 
  1331.  Bar                      Use this to plot a Bar chart in the Chart window. 
  1332.  Line                     Use this to plot a Line chart in the Chart window. 
  1333.  HL Close                 Use this to plot a High-Low Close chart in the Chart 
  1334.                           window. 
  1335.  Area                     Use this to plot an area chart in the Chart window. 
  1336.  Pie                      Use this to plot a Pie chart in the Chart window. 
  1337.  2 Dimensions             Use this to show the current chart in 2 dimensions. 
  1338.  3 Dimensions             Use this to show the current chart in 3 dimensions. 
  1339.  Toolbar                  Use this option to show or suppress the toolbar on 
  1340.                           the Chart window. 
  1341.  Information Bar          Use this option to show or suppress the Information 
  1342.                           bar on the Chart window. 
  1343.  
  1344.  
  1345. ΓòÉΓòÉΓòÉ 8.4.9. Chart window - Window menu ΓòÉΓòÉΓòÉ
  1346.  
  1347. The Window menu contains the following options. 
  1348.  
  1349.  Viewer         Use this to show the Viewer. 
  1350.  SQL            Use this to show the SQL window. 
  1351.  
  1352.  
  1353. ΓòÉΓòÉΓòÉ 8.4.10. Chart window - Utilities menu ΓòÉΓòÉΓòÉ
  1354.  
  1355. The Utilities menu has the following options: 
  1356.  
  1357.  Database       Use this to create or erase DB2/2 databases. 
  1358.  Table          Use this to define, alter the definition of, create, append to, 
  1359.                 or erase tables. 
  1360.  Sessions       Use this to register logons to be used when XY-Query connects 
  1361.                 to various databases. 
  1362.  
  1363.  
  1364. ΓòÉΓòÉΓòÉ 8.4.11. Chart window - Help menu ΓòÉΓòÉΓòÉ
  1365.  
  1366. The Help menu enables various types of help to be invoked for the application. 
  1367.  
  1368.  General Help          Use this to display general help for the Chart window 
  1369.  Keys Help             Use this to display help explaining which key 
  1370.                        combinations can be used to perform actions within the 
  1371.                        Chart window. 
  1372.  Product Information   Use this to display the XY-Query about box. 
  1373.  
  1374.  
  1375. ΓòÉΓòÉΓòÉ 8.4.12. Chart window - toolbar ΓòÉΓòÉΓòÉ
  1376.  
  1377. The items available on the Chart window toolbar are: 
  1378.  
  1379.        Save current object 
  1380.        Copy to a new object 
  1381.        Print Chart 
  1382.        Show Chart window settings 
  1383.        Open Chart settings at Subset Page 
  1384.        Show data as a bar chart 
  1385.        Show data as a line chart 
  1386.        Show data as a high-low close chart 
  1387.        Show data as an area chart 
  1388.        Show data as a pie chart 
  1389.        Show chart in 2 dimensions 
  1390.        Show chart in 3 dimensions 
  1391.        Switch to Viewer window 
  1392.        Switch to SQL window 
  1393.        Get help 
  1394.  
  1395.  For more detailed descriptions of the functions available from the Chart 
  1396.  window see chapter Working with the Chart window and Chart window settings. 
  1397.  
  1398.  
  1399. ΓòÉΓòÉΓòÉ 8.5. Procedure window ΓòÉΓòÉΓòÉ
  1400.  
  1401.  
  1402. ΓòÉΓòÉΓòÉ 8.5.1. Purpose ΓòÉΓòÉΓòÉ
  1403.  
  1404. The Procedure Window is displayed when a Procedure object is opened. Its 
  1405. primary functions of the are to display , construct and execute XY-Query REXX 
  1406. procedures. 
  1407.  
  1408. For more detailed descriptions of the functions available from the Procedure 
  1409. window and the available REXX interface functions, see chapter XY-Query 
  1410. Procedures. 
  1411.  
  1412.  
  1413. ΓòÉΓòÉΓòÉ 8.5.2. Appearance ΓòÉΓòÉΓòÉ
  1414.  
  1415. The Procedure window is constructed of a number of elements: 
  1416.  
  1417.  Element           Description 
  1418.  Title Bar         Shows name of current object and the window type i.e. PROC. 
  1419.  Menu Bar          Details all menus available from the Procedure window. 
  1420.  Toolbar           Used to provide you with fast path access to commonly used 
  1421.                    functions. 
  1422.  Editor            Area you can use to build a procedure. 
  1423.  Information Bar   Used to display status and information messages to you. 
  1424.  
  1425.  XY-Query Procedure window 
  1426.  
  1427.  
  1428. ΓòÉΓòÉΓòÉ 8.5.3. Procedure window - File menu ΓòÉΓòÉΓòÉ
  1429.  
  1430. The File menu contains the following options. 
  1431.  
  1432.  New            Use this to open a new 'Untitled' XY-Query Procedure session. 
  1433.                 It will have no link to the object from which it was spawned 
  1434.                 and will be initialised with the relevant default attributes 
  1435.                 from the Settings facility. 
  1436.  Save           Use this to save the current state of the procedure object. If 
  1437.                 the object is 'Untitled' then save can not be actioned directly 
  1438.                 but does invoke the 'Copy To' facility described below to 
  1439.                 create a new object with all of the attributes of the current 
  1440.                 object. 
  1441.  Copy To        Use this to create a new object identical to the current state 
  1442.                 of the object. 
  1443.  Quit           Use this to close the Procedure window (and hence the Procedure 
  1444.                 object) without saving any of the current settings 
  1445.  Print          Use this to print to contents of the Procedure editor to a 
  1446.                 selected printer. 
  1447.  
  1448.  
  1449. ΓòÉΓòÉΓòÉ 8.5.4. Procedure window - Edit menu ΓòÉΓòÉΓòÉ
  1450.  
  1451. The Edit menu contains the following options. 
  1452.  
  1453.  Select All     Use this to mark (highlight) all of the text in the Procedure 
  1454.                 editor. 
  1455.  Deselect All   Use this to de-highlight all marked text in the Procedure 
  1456.                 editor. 
  1457.  Cut            Use this to move any marked text in the Procedure editor to the 
  1458.                 clipboard. The marked text is deleted from the editor. 
  1459.  Copy           Use this to copy any marked text in the Procedure editor to the 
  1460.                 clipboard. The marked text is left unchanged. 
  1461.  Paste          Use this to paste the contents of the clipboard into the 
  1462.                 Procedure editor at the current cursor position. 
  1463.  Clear          Use this to remove all text from the Procedure editor. 
  1464.  
  1465.  
  1466. ΓòÉΓòÉΓòÉ 8.5.5. Procedure window - Procedure menu ΓòÉΓòÉΓòÉ
  1467.  
  1468. The Procedure menu contains the following options. 
  1469.  
  1470.  Run            Use this to start the execution of the XY-Query Procedure query 
  1471.                 currently in the Procedure editor. 
  1472.  Stop           Use this to request that the currently executing Procedure is 
  1473.                 stopped. The Procedure will terminate when the current REXX 
  1474.                 statement has completed. 
  1475.  Skeleton       Use this to insert skeleton code for a Procedure in the 
  1476.                 Procedure editor. 
  1477.  Models         Use this to show a the list of available XY-Query procedure 
  1478.                 functions. Selecting one gives an example of the syntax of the 
  1479.                 command. 
  1480.  Import         Use this to import a Procedure from another XY-Query Procedure 
  1481.                 object or from a REXX command (.CMD) file. 
  1482.  Export         Use this to export the Procedure to a command file. 
  1483.  
  1484.  
  1485. ΓòÉΓòÉΓòÉ 8.5.6. Procedure window - View menu ΓòÉΓòÉΓòÉ
  1486.  
  1487. The View menu contains the following options. 
  1488.  
  1489.  Open Settings    Use this to open the Procedure window settings notebook. 
  1490.  Browse           Use this option to set the Procedure editor to read only 
  1491.                   mode. 
  1492.  Update           Use this option to set the Procedure editor to read / write 
  1493.                   mode. 
  1494.  Toolbar          Use this option to show or suppress the toolbar on the 
  1495.                   Procedure window. 
  1496.  Information Bar  Use this option to show or suppress the Information bar on 
  1497.                   the Procedure window. 
  1498.  
  1499.  
  1500. ΓòÉΓòÉΓòÉ 8.5.7. Procedure window - Help menu ΓòÉΓòÉΓòÉ
  1501.  
  1502. The Help menu enables various types of help to be invoked for the application. 
  1503.  
  1504.  General Help          Use this to display general help for the Chart window 
  1505.  Keys Help             Use this to display help explaining which key 
  1506.                        combinations can be used to perform actions within the 
  1507.                        Procedure window. 
  1508.  Product Information   Use this to display the XY-Query about box. 
  1509.  
  1510.  
  1511. ΓòÉΓòÉΓòÉ 8.5.8. Procedure window - toolbar ΓòÉΓòÉΓòÉ
  1512.  
  1513. The items available on the Procedure window toolbar are as follows: 
  1514.  
  1515.        Save current object 
  1516.        Copy to a new object 
  1517.        Print Procedure text 
  1518.        Show Procedure window settings 
  1519.        Run Procedure 
  1520.        Halt execution of Procedure 
  1521.        Procedure models 
  1522.        Cut to OS/2 clipboard 
  1523.        Copy to OS/2 clipboard 
  1524.        Paste from OS/2 clipboard 
  1525.        Set window to browse (Read Only) mode 
  1526.        Set window to update (Read/Write) mode 
  1527.        Get help 
  1528.  
  1529.  
  1530. ΓòÉΓòÉΓòÉ 9. Working with the SQL window ΓòÉΓòÉΓòÉ
  1531.  
  1532.  
  1533. ΓòÉΓòÉΓòÉ 9.1. Introduction ΓòÉΓòÉΓòÉ
  1534.  
  1535. This chapter explains how to use the XY-Query SQL window to create, maintain 
  1536. and execute queries. It also describes the other facilities available from the 
  1537. window and the Settings notebook. 
  1538.  
  1539.  
  1540. ΓòÉΓòÉΓòÉ 9.2. Creating queries in the SQL editor ΓòÉΓòÉΓòÉ
  1541.  
  1542. Each XY-Query SQL, Viewer and Chart object relies on the existence of a query 
  1543. in the editor of the SQL window to enable data to be retrieved from a table in 
  1544. a database. This query can be produced in a number of different ways: 
  1545.  
  1546.      By manually typing it into the SQL editor. 
  1547.      By importing from the OS/2 clipboard. 
  1548.      By inserting a pre-written `model' into the SQL editor and editing it as 
  1549.       required. 
  1550.      By importing a query that resides in an external database system. 
  1551.      By importing from an external file. 
  1552.      By using the automatic query building facility, Query Builder. 
  1553.  
  1554.  
  1555. ΓòÉΓòÉΓòÉ 9.2.1. Using SQL models ΓòÉΓòÉΓòÉ
  1556.  
  1557. The Models option provides an aid to writing a query by giving examples of the 
  1558. syntax of many SQL commands. A list of available Models is presented from which 
  1559. you can choose. The chosen Model is then inserted into the SQL editor and you 
  1560. can then amend it if required. 
  1561.  
  1562. To use the Models option: 
  1563.  
  1564.    1. Open the Query menu and select Models to display a dialog box. 
  1565.  
  1566.       Sql Models 
  1567.  
  1568.  
  1569.    2. Select the model required from the list. 
  1570.    3. Press OK to insert the model to the SQL editor. 
  1571.    4. Edit the model text as required. 
  1572.  
  1573.  
  1574. ΓòÉΓòÉΓòÉ 9.2.2. Importing queries ΓòÉΓòÉΓòÉ
  1575.  
  1576. The Import facility allows you to import queries from outside the XY-Query 
  1577. environment.  You can import queries developed by other XY-Query users or in 
  1578. certain other query formats or database queries, held locally or remotely in 
  1579. DB2/2, DB2, SQL/DS and XDB databases. 
  1580.  
  1581. To import a query open the Query menu and select Import. You can import a query 
  1582. held in a file or a database. Select From File to import a query from another 
  1583. XY-Query object or other query format or select From Database to import a query 
  1584. stored in a DB2/2, Database Manager, DB2, SQL/DS or XDB database. 
  1585.  
  1586.      Importing a query from a file 
  1587.  
  1588.       When the Import - From File option is selected a dialog box is displayed 
  1589.       from where the type and directory path of the source query can be 
  1590.       defined. 
  1591.  
  1592.       Use the Format pulldown to specify the type of object from which the file 
  1593.       is to be imported. 
  1594.  
  1595.       There are four options: 
  1596.  
  1597.         -  XYQuery 
  1598.         -  IBM SQL statement 
  1599.         -  DDQS/2 Query  (.QRY) 
  1600.         -  Plain text 
  1601.  
  1602.       Either type in a name of the file to be imported in the Name field, and 
  1603.       its file path in the Directory field, or use the Names and Directories 
  1604.       lists to specify the file. 
  1605.  
  1606.       When the dialog has been completed, press Import to retrieve the 
  1607.       targetted query and display it in the SQL editor. 
  1608.  
  1609.      Importing a query from a database 
  1610.  
  1611.       When the Import - From Database option is selected a dialog box is 
  1612.       displayed from where the name of the source query and location can be 
  1613.       defined. 
  1614.  
  1615.       Import a query from a database 
  1616.  
  1617.       Select the location at which the query resides from the pulldown. If the 
  1618.       name of the query is known then it can be entered into the Name field 
  1619.       directly. Otherwise, you can specify the query name by using the owner 
  1620.       and name/comment lists. Press the Refresh button to fill the Owners list 
  1621.       with all userids that own queries that are available to you. Double-click 
  1622.       on an owner to see all available queries associated with that owner. 
  1623.  
  1624.       When the correct Owner-Query combination has been selected, press OK to 
  1625.       retrieve the named query from the database and display it in the SQL 
  1626.       window. 
  1627.  
  1628.  To successfully import queries from database systems you need authority to 
  1629.  read the tables that hold the query definitions in the database. 
  1630.  
  1631.  To import QMF queries from either DB2/MVS or SQL/DS you must have SELECT 
  1632.  access to the following tables: 
  1633.  
  1634.      Q.OBJECT_DIRECTORY 
  1635.  
  1636.      Q.OBJECT_DATA 
  1637.  
  1638.      Q.OBJECT_REMARKS 
  1639.  
  1640.  To import Query Manager queries from DB2/2 databases requires you to have 
  1641.  SELECT access to the table QRWSYS.QRWSYS_OBJECT. 
  1642.  
  1643.  To import XDB queries you must have SELECT access to the table 
  1644.  SYSXDB.SYSQUERY. 
  1645.  
  1646.  
  1647. ΓòÉΓòÉΓòÉ 9.2.3. Running queries ΓòÉΓòÉΓòÉ
  1648.  
  1649. You can run a query defined in the SQL editor or the Query Builder, in the 
  1650. following ways: 
  1651.  
  1652.      Select the Run option  from the Query menu. 
  1653.      Press the Run button on the main SQL window toolbar. 
  1654.      Use the Shift and F1 key combination. 
  1655.      Open an existing Viewer or Chart object with a query already defined. 
  1656.  
  1657.  Note:  If you are using the Query Builder, the query defined so far is 
  1658.  constructed and placed in the SQL editor and the location selected is 
  1659.  reflected in the location selection pulldown. 
  1660.  
  1661.  Each method of running reads the query from the SQL editor and then sends a 
  1662.  request to the location selected to run the query. 
  1663.  
  1664.  If there are any variables in the query (see Substitution variables), a dialog 
  1665.  box is displayed requesting the values be specified. In this case, enter the 
  1666.  run time values and press on Submit. 
  1667.  
  1668.  If the query type was Select and ran successfully, the output is available 
  1669.  from the Viewer and Chart windows.  If it failed, an error message is 
  1670.  displayed in the Information Bar. 
  1671.  
  1672.  After inspecting the output, the query in the SQL editor can be modified and 
  1673.  then run again.  When this is done, the output in the Viewer and/or Chart 
  1674.  Window is refreshed. 
  1675.  
  1676.  Non-SELECT type queries such as INSERT, UPDATE and DELETE do not cause the 
  1677.  Viewer or Chart to be shown. Such queries cause modifications to be made to 
  1678.  tables. You are asked to confirm the modifications before the query completes 
  1679.  and commits its changes. The Information Bar displays information on how many 
  1680.  rows in the table have been modified by the query. 
  1681.  
  1682.  Other administrative type queries such as GRANT do not cause the Viewer to be 
  1683.  shown and notification of completion or otherwise is posted on the Information 
  1684.  Bar. 
  1685.  
  1686.  Every query that runs successfully can be added automatically to the History 
  1687.  Ring (depending on the selections made on the History Page of the SQL window 
  1688.  settings notebook see History page). A query that runs successfully is either 
  1689.  one that retrieves or modifies data (SQL return code 0), or one that correctly 
  1690.  interrogates the database without finding matching data (SQL return code 100). 
  1691.  
  1692.  When the definition of the query is complete, it forms the basis of an SQL, 
  1693.  Viewer or Chart object. The query is saved with the object as explained in 
  1694.  Saving from the SQL window. 
  1695.  
  1696.  You can use command line arguments to XY-Query (XY-Query command line 
  1697.  interface) to run a query defined to an object automatically. 
  1698.  
  1699.  Note: 
  1700.  
  1701.    1. For a query to run, XY-Query must be connected to the chosen database. 
  1702.       This connection is retained after the query finishes so that subsequent 
  1703.       queries against that same database will not incur the overhead of 
  1704.       connection. However, if no query is run for 30 minutes, XY-Query 
  1705.       automatically breaks the connection with the database. 
  1706.    2. Each XY-Query session is connected only to one database at any time. 
  1707.    3. An SQL object can execute any valid SQL query. Viewer and Chart objects 
  1708.       however permit only SELECT queries to be executed. 
  1709.  
  1710.  
  1711. ΓòÉΓòÉΓòÉ 9.2.4. Substitution variables ΓòÉΓòÉΓòÉ
  1712.  
  1713. When building a query, it is often a requirement to specify variables for which 
  1714. you can substitute a value at run-time.  For example, you might need to enter 
  1715. today's date, or the query might require a minimum and maximum value for a 
  1716. field, leaving you to specify them as required. 
  1717.  
  1718. To create a substitution variable, precede its name by an ampersand in the 
  1719. query, thus: 
  1720.  
  1721. SELECT ID, NAME, DEPT, JOB, YEARS, SALARY, COMM
  1722. FROM  USERID.STAFF
  1723. WHERE  DEPT  =  &DEPT
  1724.  
  1725. XY-Query takes the string of letters after the ampersand to be the name of the 
  1726. substitution variable.  For character columns within the database, you are 
  1727. advised to enclose the variable name in inverted commas, thus: 
  1728.  
  1729. SELECT ID, NAME, DEPT, JOB, YEARS, SALARY, COMM
  1730. FROM  USERID.STAFF
  1731. WHERE  JOB  =  '&JOB'
  1732.  
  1733. In this case, you do not need to know the data type required when entering 
  1734. values for the variable. 
  1735.  
  1736. Alternatively, you can omit the inverted commas when defining a character 
  1737. string variable, but you must enter the inverted commas as well as the value. 
  1738.  
  1739. When the query is run, a dialog box is displayed, asking for values for the 
  1740. variables. See Specify values for substitution variables. 
  1741.  
  1742. Specify values for substitution variables 
  1743.  
  1744. This dialog has a number of built in facilities which are aimed at aiding you 
  1745. in your variable value specification. 
  1746.  
  1747. XY-Query remembers the last value you specified for a particular variable name. 
  1748. When the dialog is displayed XY-Query primes the entry areas for any variables 
  1749. it recognises with the values it has retained. These values can be accepted or 
  1750. changed. A list of all variables being maintained by XY-Query can be viewed in 
  1751. the Variables page of the General section of the XY-Query Settings facility, 
  1752. see General Settings - Variables page. Unwanted variables can also be removed 
  1753. from XY-Query from this page. 
  1754.  
  1755. Each variable is associated with its own entry area. To the right of these 
  1756. areas is a button which, when pressed, causes the entry area to expand. You can 
  1757. use this when specifying data into a character field which can can cope with 
  1758. free format text. 
  1759.  
  1760. Some key words have been defined which are recognised by XY-Query and can be 
  1761. used in place of specifying an actual value for a date or time related 
  1762. variable. These generally match up with similar key words defined to the SQL 
  1763. language 
  1764.  
  1765.  Keyword             Description 
  1766.  USER                currently logged on userid 
  1767.  CURRENT TIME        The current system time 
  1768.  NOW                 The current system time (an alternative to CURRENT TIME) 
  1769.  CURRENT DATE        The current system date 
  1770.  TODAY               The current system date (an alternative to CURRENT DATE) 
  1771.  TOMORROW            The current system date plus one day 
  1772.  YESTERDAY           The current system date less one day 
  1773.  CURRENT TIMESTAMP   The current system timestamp 
  1774.  
  1775.  If you wish to reset all entry area in the dialog to be empty press the Clear 
  1776.  All button. To reset a specific field,  place the cursor on the field in 
  1777.  question and press the Clear Line button or use the Ctrl+Delete key 
  1778.  combination. 
  1779.  
  1780.  If you decide not to run the query then press the Cancel button. Any values 
  1781.  specified before the dialog was cancelled are not retained. 
  1782.  
  1783.  When you have specified all the variable, press the Submit button to cause the 
  1784.  values to be substituted into the query. The query will then run using these 
  1785.  values. 
  1786.  
  1787.  Note: 
  1788.  
  1789.    1. To specify a value to be null type null in the entry area for the 
  1790.       variable. This applies to all SQL types. 
  1791.    2. Substitution variables may be case-sensitive. depending on the Case 
  1792.       attribute of the object as defined in the SQL window settings notebook 
  1793.       Case page. 
  1794.    3. This dialog will be displayed whenever a query is run that requires run 
  1795.       time variables specified. It will appear without the SQL window if a 
  1796.       Viewer or chart object is opened that runs a query requiring user data. 
  1797.       It will also be displayed from within a Procedure if a query being 
  1798.       executed within the procedure requires run time data. 
  1799.  
  1800.  
  1801. ΓòÉΓòÉΓòÉ 9.2.5. Terminating queries ΓòÉΓòÉΓòÉ
  1802.  
  1803. You can terminate a running query and show the output generated so far by 
  1804. opening the Query menu and selecting Stop or by pressing the Stop button on the 
  1805. toolbar. Query execution terminates when the current block of data has been 
  1806. returned from the database. 
  1807.  
  1808. Note:  Running queries can also be stopped by using the relevant menu options 
  1809. from the Viewer or Chart windows. 
  1810.  
  1811.  
  1812. ΓòÉΓòÉΓòÉ 9.3. Using the Query Builder ΓòÉΓòÉΓòÉ
  1813.  
  1814. You invoke the Query Builder by selecting the Builder option from the View menu 
  1815. or by pressing the Builder button on the toolbar of the SQL window. 
  1816.  
  1817. You can exit the Query Builder at any time by selecting the Edit Sql option 
  1818. from the View menu or pressing the Edit SQL toolbar button.  The SQL window 
  1819. reverts to its Edit SQL view and will display a query constructed automatically 
  1820. by the Query Builder depending upon the information you entered while in the 
  1821. Builder, 
  1822.  
  1823. The Builder consists of a number of panels with which you interact to produce 
  1824. an SQL query. This query can then be run directly against a location or shown 
  1825. in the SQL editor when the Builder is exited. 
  1826.  
  1827. In total there are eight panels although the availability of certain panels 
  1828. depends upon the type of query being constructed. The panels that are available 
  1829. are as follows: 
  1830.  
  1831.            Select SQL Statement  (All query types)
  1832.  
  1833.            Select Location       (All query types)
  1834.  
  1835.            Select Tables         (All query types)
  1836.  
  1837.            Table Connections     (SELECT only)
  1838.  
  1839.            Calculated Columns    (SELECT only)
  1840.  
  1841.            Select Columns        (SELECT and UPDATE only)
  1842.  
  1843.            Select Rows           (SELECT, UPDATE and DELETE only)
  1844.  
  1845.            Order Rows            (SELECT only)
  1846.  
  1847.  The first time the Query Builder is invoked, it displays the Select Locations 
  1848.  panel from where you choose the location against which to run a query. (The 
  1849.  statement type of SELECT has been pre-selected on the first panel although 
  1850.  this can be changed by moving back to it to choose one of the other statement 
  1851.  types.) 
  1852.  
  1853.  
  1854. ΓòÉΓòÉΓòÉ 9.3.1. Query Builder - toolbar ΓòÉΓòÉΓòÉ
  1855.  
  1856. The panels can be selected via the toolbar under the panels when the window is 
  1857. switched into its Builder view. The toolbar changes dynamically to reflect the 
  1858. panels that are available. The toolbar consists of buttons for each panel 
  1859. together with buttons to move forward and backwards through the panels and a 
  1860. Help button. 
  1861.  
  1862.        Display Previous Panel 
  1863.        Display Next Panel 
  1864.        Select SQL Statement Panel 
  1865.        Select Location Panel 
  1866.        Select Tables Panel 
  1867.        Table Connections Panel 
  1868.        Calculated Columns Panel 
  1869.        Select Columns Panel 
  1870.        Select Rows Panel 
  1871.        Order Rows Panel 
  1872.        Display help for currently displayed panel 
  1873.  
  1874.  
  1875. ΓòÉΓòÉΓòÉ 9.3.2. Query Builder - Select SQL Statement panel ΓòÉΓòÉΓòÉ
  1876.  
  1877. Query Builder - Select SQL Statement panel 
  1878.  
  1879. This panel enables you to select the type of SQL query statement that you want 
  1880. to construct. There are four options available: 
  1881.  
  1882.      SELECT Query 
  1883.      INSERT Query 
  1884.      UPDATE Query 
  1885.      DELETE Query 
  1886.  
  1887.  You select the statement type you want by pressing the appropriate button. 
  1888.  
  1889.  The type of query selected affects the other panels that are available. For 
  1890.  example, a SELECT query enables interaction with all eight Builder panels, but 
  1891.  an INSERT query requires interaction with only three. When a query type is 
  1892.  selected, the Builder toolbar changes to show the panels that can be accessed. 
  1893.  
  1894.  Also on this panel you can view and edit comments for the query. If the 
  1895.  Builder has been set up following a parse of a query written in the sql editor 
  1896.  all comments detected in the query will be placed in the comments area. 
  1897.  
  1898.  When a query is built and displayed in the sql editor any comments defined on 
  1899.  this page will be placed at the top of the query, each line preceded with two 
  1900.  dashes to indicate a comment. 
  1901.  
  1902.  
  1903. ΓòÉΓòÉΓòÉ 9.3.3. Query Builder - Select Location panel ΓòÉΓòÉΓòÉ
  1904.  
  1905. Query Builder - Select Location panel 
  1906.  
  1907. This panel enables you to select the location against which the query will be 
  1908. run. 
  1909.  
  1910. Choose the target location by selecting one from the displayed list of all 
  1911. known locations. 
  1912.  
  1913. To connect XY-Query to the selected location, double click on the required 
  1914. location in the list, or select the entry and press the Enter key. 
  1915. Alternatively, XY-Query automatically connects to the selected location when 
  1916. the Select Tables panel is brought forward. 
  1917.  
  1918.  
  1919. ΓòÉΓòÉΓòÉ 9.3.4. Query Builder - Select Tables panel ΓòÉΓòÉΓòÉ
  1920.  
  1921. The Select Tables panel enables you to select the tables which contain the data 
  1922. you want to retrieve. 
  1923.  
  1924. Query Builder - Select Tables panel 
  1925.  
  1926. Choose the target tables by selecting from the list of tables presented in the 
  1927. lists at the top of the panel. 
  1928.  
  1929. The panel has two lists at the top which can be used in conjunction to select 
  1930. those tables that contain the data. A table name is made up of two parts, the 
  1931. table creator and the table name. The left hand list contains all Table 
  1932. Creators in the database. When one of these is selected it populates the right 
  1933. hand list with the names of all tables associated with it together with any 
  1934. available table description. 
  1935.  
  1936. When the correct Creator - Table Name combination has been found (that is both 
  1937. parts are highlighted in their respective lists), then select it by double 
  1938. clicking the mouse on the table name or by pressing the Add button. This adds 
  1939. the full table name into the list at the bottom of the panel. The new entry 
  1940. will be added directly after the currently highlighted entry. 
  1941.  
  1942. There are restrictions as to the selection of tables inasmuch as INSERT, UPDATE 
  1943. and DELETE queries can only operate on a single table but SELECT statements can 
  1944. be written against multiple tables. To this end this panel only allows a single 
  1945. table to be selected for all but SELECT statements and limits the number of 
  1946. tables for a SELECT to twenty-six. 
  1947.  
  1948. To change a selected table to another, firstly select the correct table name 
  1949. and creator combination. Then highlight the incorrect table name in the bottom 
  1950. list and press the Replace button. This will then replace the old table name 
  1951. entry with the new selection. 
  1952.  
  1953. To remove a table from the list of selected tables, select it in the list and 
  1954. then press the Remove button. 
  1955.  
  1956. If the tables selected are changed after other elements of the query have been 
  1957. defined on other panels, then by implication it means that the other 
  1958. information is redundant. This information will be automatically removed from 
  1959. the other panels and information such as table connections and column 
  1960. selections will have to be redefined. 
  1961.  
  1962. Note: 
  1963.  
  1964.    1. The creator and table name lists may be limited by setting filters in the 
  1965.       Wildcards page of the Sql window settings. 
  1966.  
  1967.    2. For the creator and table name lists to be filled, you must have access 
  1968.       to read certain tables which contain the catalogue information. By 
  1969.       default, XY-Query will try to use the system catalogue tables for a 
  1970.       location. There are two tables which will be used to return the creator 
  1971.       and table information, depending upon whether the lists are restricted to 
  1972.       those to which you have authority or not. The catalogue tables XY-Query 
  1973.       will use are named in the Table Names page of the SQL section of the 
  1974.       settings facility, see SQL Settings - Table Names page. 
  1975.  
  1976.  
  1977. ΓòÉΓòÉΓòÉ 9.3.5. Query Builder - Table Connections panel ΓòÉΓòÉΓòÉ
  1978.  
  1979. This panel is available only when a SELECT statement against multiple tables is 
  1980. being built. It enables the conditions by which the tables are connected, or 
  1981. joined, to be defined. It is important for multi-table SELECT statements that 
  1982. all tables are joined correctly or the query could give unpredictable results. 
  1983.  
  1984. Query Builder - Table Connections panel 
  1985.  
  1986. At the top of the panel there are two lists containing table column details 
  1987. separated by a list of connectors. To define a connection between two tables, 
  1988. you select one item from each list. 
  1989.  
  1990. The left hand list contains entries for every column in every table selected in 
  1991. the previous panel. When a column is selected from this list it automatically 
  1992. populates the right hand list. The content of this list is determined by the 
  1993. item that was selected from the left hand list. The table that the column 
  1994. selected exists in and its type are the critical factors here. The right hand 
  1995. list is populated with columns from all tables other than the one in which the 
  1996. left hand column exists that are of a similar type. 
  1997.  
  1998. For example, if three tables A, B and C have been selected and a numeric column 
  1999. from table A has been chosen in the left hand list, then the right hand list is 
  2000. filled with all numeric columns from tables B and C. This is because tables can 
  2001. be connected only via like columns. 
  2002.  
  2003. When a choice is made from the right hand list and from the list of connectors, 
  2004. the table connection condition can be entered into the list at the bottom of 
  2005. the panel by pressing the Add button. 
  2006.  
  2007. All tables that are included in a multi-table SELECT statement must be included 
  2008. in at least one join condition. As a rule of thumb, the number of join 
  2009. conditions that must be defined is one less than the number of tables selected. 
  2010. If these conditions are not defined, then the final query will produce 
  2011. unpredictable results. 
  2012.  
  2013. To change a connection condition, define the new condition, highlight the 
  2014. incorrect condition in the bottom list and then press the Replace button. 
  2015.  
  2016. To remove a connection condition from the list of those defined, simply 
  2017. highlight it in the list and then press the Remove button. 
  2018.  
  2019. If a connection condition showing in the bottom list is double-clicked then the 
  2020. top three selection lists will be set to match the selected predicate. 
  2021.  
  2022.  
  2023. ΓòÉΓòÉΓòÉ 9.3.6. Query Builder - Calculated Columns panel ΓòÉΓòÉΓòÉ
  2024.  
  2025. This panel is available only when a SELECT statement is being constructed. It 
  2026. allows the definition of user-defined calculations and expressions which can be 
  2027. included in the list of columns that is returned by the query when it has run. 
  2028.  
  2029. Query Builder - Calculated Columns panel 
  2030.  
  2031. To create an expression you can either use information provided by XY-Query, 
  2032. type it manually or use a combination of both. 
  2033.  
  2034. In the centre of the page is an entry field in which the expression is 
  2035. constructed. It is free format for you to enter what you like. No edit checking 
  2036. will be performed on the expressions you create, apart from preventing you 
  2037. entering blank or duplicate expressions. 
  2038.  
  2039. At the top of the page there are two list boxes. The left hand list, titled 
  2040. Operand & Operator Types, contains a list of operand and operator types. When 
  2041. one of these items is selected is causes the right hand list, titled Operands & 
  2042. Operators, to be populated. This second list provides you with assistance by 
  2043. detailing for example, all of the column names in the selected tables. 
  2044.  
  2045. A double-click on an entry in this list will cause the selected text to be 
  2046. appended to the expression in the expression entry field. 
  2047.  
  2048. To erase the expression currently being built you can press the button marked 
  2049. C. 
  2050.  
  2051. When the expression has be written you must press the Add button to add it to 
  2052. the list of expressions at the bottom of the page. 
  2053.  
  2054. To replace an expression, simply highlight the expression to be changed in the 
  2055. bottom list and then press the Replace button. 
  2056.  
  2057. To remove an expression from the list of those defined simply highlight it in 
  2058. the bottom list and then press the Remove button. 
  2059.  
  2060. If an expression in the bottom list is double-clicked, then the text of the 
  2061. expression will be placed in the expression entry field. This will cause 
  2062. anything currently in the entry field to be over-written. 
  2063.  
  2064.  
  2065. ΓòÉΓòÉΓòÉ 9.3.7. Query Builder - Select Columns panel ΓòÉΓòÉΓòÉ
  2066.  
  2067. This panel is available only for SELECT and UPDATE statements. It enables you 
  2068. to define the columns that are to be selected in the case of a SELECT query or 
  2069. updated in the case of an UPDATE query. 
  2070.  
  2071. Query Builder - Select Columns panel 
  2072.  
  2073. The panel consists of a list containing all the columns from all the selected 
  2074. tables plus any calculated columns for a SELECT query, together with some 
  2075. buttons to aid the selection of columns from the list. 
  2076.  
  2077. In its initial state, all items (columns) in the list are selected for 
  2078. inclusion into the final query. You can  de-select those columns you do not 
  2079. want and also specify the order in which the columns are included into the 
  2080. query. This ordering is important only for SELECT queries as it defines the 
  2081. sequence in which the data is presented in the Viewer when it is returned from 
  2082. the database. The number visible on the extreme left hand side of the listed 
  2083. items denotes its position in the final query. 
  2084.  
  2085. When a column is de-selected from the list the positions of all other selected 
  2086. columns are automatically updated to take account of the removal. When a column 
  2087. is selected then the next available position is associated with this item. This 
  2088. means that columns can be selected in the order in which, for SELECT queries, 
  2089. the data will be presented. 
  2090.  
  2091. As well as column name entries in the list there are entries relating to the 
  2092. tables that have been selected. These appear directly before the list of 
  2093. columns within that table. Although these items cannot be included as a 
  2094. selected and positioned column they can be used to aid the selection and 
  2095. de-selection of columns within them.  De-selecting a table name item 
  2096. automatically de-selects all columns within it and causes the re-numbering of 
  2097. other selected columns as appropriate.  Selecting a table name item selects all 
  2098. currently un-selected columns within it with the appropriate numbering. 
  2099.  
  2100. To de-select all columns that have been selected, press the Deselect All 
  2101. button. To select all columns in the list press the Select All button.  This 
  2102. selects every column that is not currently selected and allocates the newly 
  2103. selected columns ascending position numbers from the top to the bottom of the 
  2104. list. 
  2105.  
  2106.  
  2107. ΓòÉΓòÉΓòÉ 9.3.8. Query Builder - Select Rows panel ΓòÉΓòÉΓòÉ
  2108.  
  2109. This panel is available only for SELECT, UPDATE and DELETE statements. You 
  2110. define conditions that determine which rows in the tables are to be retrieved. 
  2111.  
  2112. Query Builder - Select Rows panel 
  2113.  
  2114. Each condition consists in general of a left hand operand which is a column 
  2115. name from one of the selected tables, a connector which defines the type of 
  2116. comparison to be performed and a right hand operand which can be user defined 
  2117. text or another column. Each of these conditions is called a predicate. 
  2118.  
  2119. At the top of the panel are three drop down lists from where the left hand 
  2120. operand, connector and right hand operand can be defined. In certain cases, the 
  2121. drop down list for the right hand operand can be removed in favour or one or 
  2122. two entry fields for user defined text. The decision over which controls to 
  2123. display to enable the right hand operand to be entered depends on the connector 
  2124. that has been chosen. For example, if an IN connector is selected then a single 
  2125. entry field is shown from where you must enter the list of values. If a BETWEEN 
  2126. connector is selected then two entry fields are shown in which you must specify 
  2127. the upper and lower bounds for the predicate. If the IS NULL or IS NOT NULL 
  2128. connector is selected however, there is no requirement for a right hand operand 
  2129. as the predicate is already complete. 
  2130.  
  2131. Note:  You can specify XY-Query run time variables in the cases where the right 
  2132. hand operand consists of user defined text. These take the form of a user 
  2133. defined name preceded by an ampersand. For example, &DEPT.  This means that you 
  2134. can substitute a value for this variable at run time. 
  2135.  
  2136. The selection of the column from the left hand operand list determines the 
  2137. content of the connector list and the right hand operand column list. There are 
  2138. certain connectors that can only be used in conjunction with character fields 
  2139. and these will only be available in the connector list if a character column 
  2140. has been selected as the left hand operand. Similarly, the right hand operand 
  2141. column list is only populated with columns of a similar type to that selected 
  2142. as the left hand operand. For example, if the left hand operand is a numeric 
  2143. column then the list for the right hand operand is populated only with numeric 
  2144. columns. 
  2145.  
  2146. When the predicate definition is complete then it can be added to the list of 
  2147. predicates at the bottom of the panel by pressing the Add button. For all but 
  2148. the first predicate defined it is necessary to decide whether the predicate 
  2149. will be prefixed with AND or OR thus dictating the way in which the selection, 
  2150. and elimination, of rows in the tables will be carried out. By selecting the 
  2151. NOT option it is possible to negate the predicate by making it  AND NOT or OR 
  2152. NOT. The predicate will be added into the list directly after the last 
  2153. highlighted entry. If none is highlighted then it will be added to the bottom 
  2154. of the list. 
  2155.  
  2156. To replace a defined predicate with another, highlight the incorrect predicate 
  2157. in the list and then press the Replace button. 
  2158.  
  2159. To remove a predicate from the list of those defined simply highlight it in the 
  2160. list and then press the Remove button. 
  2161.  
  2162. The predicates list allows multiple selections to be made. This is required in 
  2163. order to use the bracket and unbracket options. 
  2164.  
  2165. When one or more rows in the predicates list are highlighted it is possible to 
  2166. place brackets around the group of predicates bounded by the first and last 
  2167. highlighted lines. Note that it is not necessary to highlight all predicates in 
  2168. a block in order to bracket them. Simply highlighting the first and the last is 
  2169. enough to delimit the block to be bracketed. When the block has been defined 
  2170. press the Bracket button. 
  2171.  
  2172. The Unbracket button is only available when the block of predicates delimited 
  2173. by the first and last highlighted items have a matching set of brackets. 
  2174. Pressing this button will remove an open bracket from the first highlighted 
  2175. predicate and a close bracket from the last highlighted predicate. 
  2176.  
  2177. For SELECT statements there will be a box marked Remove Duplicate Rows. To 
  2178. cause all duplicate rows to be omitted from the returned data, when the query 
  2179. is run, select this option. 
  2180.  
  2181.  
  2182. ΓòÉΓòÉΓòÉ 9.3.9. Query Builder - Order Rows panel ΓòÉΓòÉΓòÉ
  2183.  
  2184. This panel is only available for SELECT statements. You use it to determine the 
  2185. order in which the data is to be returned from the database. 
  2186.  
  2187. Query Builder - Order Rows panel 
  2188.  
  2189. It is necessary to decide which columns, of those previously selected, the data 
  2190. should be sorted on and in which priority order multiple column ordering should 
  2191. be done. 
  2192.  
  2193. In its initial state no columns in the list will be selected. When a column is 
  2194. selected its row in the list will display a number indicating its sort priority 
  2195. and a button indicating the sort direction. By default, newly selected rows are 
  2196. always set to ascending order. If it is required to change the sort direction 
  2197. to you can just click on the button which will invert the arrow indicating the 
  2198. sort direction. 
  2199.  
  2200. Clicking anywhere else on a selected row will cause it to be de-selected from 
  2201. the list. 
  2202.  
  2203. Ensuring that the columns have been selected in the correct sequence and have 
  2204. the correct sort direction is the only way to guarantee that the data is 
  2205. displayed in the sequence required. If the sorting information is incorrect 
  2206. then, although the data itself will not be affected, its presentation may well 
  2207. not be what is required. 
  2208.  
  2209. As well as column name entries in the list there are entries relating to the 
  2210. tables that have been selected. These appear directly before the list of 
  2211. selected columns within that table. Although these items cannot be included as 
  2212. a selected and positioned column they can be used to aid the selection and 
  2213. de-selection of columns within them. De-selecting a table name item has the 
  2214. effect of automatically de-selecting all columns within it and causing the 
  2215. re-numbering of other selected columns as appropriate. Selecting a table name 
  2216. item has the effect of selecting all columns that are not currently selected 
  2217. within it with the appropriate numbering in an ascending direction. 
  2218.  
  2219. To de-select all columns that have been selected click on the Deselect All 
  2220. button. To select all columns in the list click on the Select All button. This 
  2221. will have the effect of selecting every column that is not currently selected 
  2222. and allocate the newly selected columns ascending position numbers from the top 
  2223. to the bottom of the list. 
  2224.  
  2225.  
  2226. ΓòÉΓòÉΓòÉ 9.3.10. Switching views in the SQL window ΓòÉΓòÉΓòÉ
  2227.  
  2228. You can switch the view of the SQL window by selecting the relevant menu item 
  2229. or toolbar button. Depending upon the view selected different actions are 
  2230. invoked: 
  2231.  
  2232.  
  2233. ΓòÉΓòÉΓòÉ 9.3.11. From builder view to edit SQL view ΓòÉΓòÉΓòÉ
  2234.  
  2235. If the SQL window is displayed in its Builder view and the Edit SQL menu option 
  2236. is selected, or the Edit SQL toolbar button is pressed, then the Edit SQL view 
  2237. is displayed. 
  2238.  
  2239. In doing this, XY-Query will attempt to construct a query based upon the 
  2240. information that has been entered so far into the various panels in the Query 
  2241. Builder. If enough information has been entered then a query will be 
  2242. constructed according to the selections made in the Query Builder panels and 
  2243. displayed in the SQL editor. 
  2244.  
  2245. If insufficient information has been entered into the Builder then no query is 
  2246. displayed in the SQL editor. 
  2247.  
  2248.  
  2249. ΓòÉΓòÉΓòÉ 9.3.12. From edit SQL view to builder view ΓòÉΓòÉΓòÉ
  2250.  
  2251. If the SQL window is in its Edit SQL view and the Builder menu option is 
  2252. selected, or the Builder toolbar button is pressed, then the Builder view is 
  2253. displayed. 
  2254.  
  2255. As the switch is made into the Builder view, XY-Query will attempt to read any 
  2256. query that is currently displayed in the SQL editor and break it down into its 
  2257. constituent parts. When this has been done, the various panels of the builder 
  2258. are then primed with the information extracted from the query in the SQL 
  2259. editor. 
  2260.  
  2261. Note:  If the SQL editor contains a query other than the standard data 
  2262. manipulation queries of SELECT, INSERT, UPDATE and DELETE then it will not be 
  2263. possible to enter the builder as it only constructs queries of these four 
  2264. types. 
  2265.  
  2266. As a result of this parsing you can change the current query from within the 
  2267. Builder environment rather than by editing the raw SQL. This is useful where, 
  2268. for example, a query has been imported into XY-Query from another source. 
  2269.  
  2270. The Query Builder has limitations as regards the complexity of the queries it 
  2271. is able to build. Therefore, it is only able to cope with syntax in parsed 
  2272. queries that it would itself have been able to construct. If the XY-Query 
  2273. parser comes across query syntax that it does not understand it displays a 
  2274. panel in the Builder that contains details of the errors it has detected as 
  2275. described in Query Builder - parsing errors notification panel. You can then 
  2276. decide to either switch back to the SQL window and manually edit the query or 
  2277. continue into the Builder and let it make its best attempt at priming the 
  2278. panels. 
  2279.  
  2280. Query Builder - parsing errors notification panel 
  2281.  
  2282. To help with tracking down the source of an error, each message details the 
  2283. line of the query at which it was detected. If you double click on an error 
  2284. message line the Sql window will revert to Edit Sql view and the line 
  2285. containing the error you selected will be marked in the window. 
  2286.  
  2287. Alternatively, you can select the Edit Sql button on either the Builder or main 
  2288. toolbar to switch back to Edit Sql view. In this case the currently selected 
  2289. error in the list will be marked in the Edit Sql window. 
  2290.  
  2291. Note: 
  2292.  
  2293.    1. If you choose to continue into the builder, parts of the original query 
  2294.       can be lost as the builder has no means of displaying them. 
  2295.    2. The XY-Query Query Builder constructs queries which have distinct blocks 
  2296.       of Join and Row conditions. To parse a set of join conditions into the 
  2297.       Builder, a similar syntactical notation must be adopted. All joins should 
  2298.       be bracketed together in the predicate list.  Not doing this can cause 
  2299.       the Builder to treat the Join conditions as standard row conditions. 
  2300.  
  2301.  When the error notification page is displayed the Builder toolbar contains 
  2302.  only the following buttons. 
  2303.  
  2304.        Switch back to the Edit SQL view 
  2305.        Continue into the Builder 
  2306.        Display help for Errors panel 
  2307.  
  2308.  
  2309. ΓòÉΓòÉΓòÉ 9.4. SQL window functions ΓòÉΓòÉΓòÉ
  2310.  
  2311. This section details the other functions available from the SQL window: 
  2312.  
  2313.      Save the current object (Saving from the SQL window) 
  2314.      Copying to an XY-Query object (Copying to an XY-Query object from the SQL 
  2315.       window.) 
  2316.      Export query outside XY-Query (Exporting queries) 
  2317.      Traverse and maintain the History Ring (Using the History Ring) 
  2318.      Print the contents of the SQL editor (Printing queries) 
  2319.      Place data in the clipboard (Copying, cutting and pasting text) 
  2320.      Utilities (Utilities from the SQL window) 
  2321.  
  2322.  
  2323. ΓòÉΓòÉΓòÉ 9.4.1. Saving from the SQL window ΓòÉΓòÉΓòÉ
  2324.  
  2325. To save, open the File menu and select Save.  This saves all information about 
  2326. all three windows associated with the current object, namely the SQL , Viewer 
  2327. and Chart windows. It will not affect the object type. It is quite valid to 
  2328. request a save from the SQL window even if the current object is a Viewer or 
  2329. Chart object. 
  2330.  
  2331.  
  2332. ΓòÉΓòÉΓòÉ 9.4.2. Copying to an XY-Query object from the SQL window. ΓòÉΓòÉΓòÉ
  2333.  
  2334. To create a copy of the current XY-Query object, open the File menu of the SQL 
  2335. window and select Copy to... to obtain the Copy-To dialog box. 
  2336.  
  2337. Copy-To dialog box 
  2338.  
  2339. Use the dialog box to specify the name and type of the new XY-Query object. 
  2340.  
  2341. Complete the fields as follows: 
  2342.  
  2343.  Format     Select one from: 
  2344.                 XYQuery 
  2345.                 XYChart 
  2346.                 XYViewer. 
  2347.  Name       Type a name, including file extension if any, for the file in the 
  2348.             field.  Alternatively, use Names to select a file to overwrite. 
  2349.  Directory  Type a file path for the file in the field.  Alternatively, you can 
  2350.             use Directories to select a path. 
  2351.  Names/Directories Use these fields to display the names and file paths of 
  2352.             existing XY-Query objects.  If necessary, select one of these and 
  2353.             overwrite it. 
  2354.  
  2355.  Press Copy to complete the operation. 
  2356.  
  2357.  A new XY-Query object of the type specified is created which is identical, in 
  2358.  all but name, to the current state of the active object. 
  2359.  
  2360.  
  2361. ΓòÉΓòÉΓòÉ 9.4.3. Exporting queries ΓòÉΓòÉΓòÉ
  2362.  
  2363. You can to export queries from the SQL editor to non XY-Query objects enabling 
  2364. them to be accessed by other applications. 
  2365.  
  2366. To export a query: 
  2367.  
  2368.    1. Open the Query menu and select Export... 
  2369.  
  2370.       The dialog box displayed is similar to the one used for copying to an 
  2371.       XY-Query object (Copy-To dialog box), except that the Format pulldown 
  2372.       contains different choices.  The formats available are: 
  2373.           IBM SQL Statement 
  2374.           DDQS/2 Query (.QRY) 
  2375.           Plain Text  (.TXT). 
  2376.    2. Complete the fields and press Export to write the query to a named file 
  2377.       of the selected type. 
  2378.  
  2379.  
  2380. ΓòÉΓòÉΓòÉ 9.4.4. Using the History Ring ΓòÉΓòÉΓòÉ
  2381.  
  2382. The History Ring is a device that enables multiple queries to be maintained 
  2383. within an individual XY-Query SQL, Viewer or Chart object. The queries 
  2384. associated with the object are held in a notional `ring'. The SQL window 
  2385. displays the `current' query from the ring at any particular time. The query 
  2386. can be displayed in either the SQL or Build view depending upon the current 
  2387. state of the window. 
  2388.  
  2389. The mode of operation of the History ring is determined by the History page of 
  2390. the SQL window settings notebook as described in History page. You can decide 
  2391. that all queries that run successfully be added automatically to the ring or 
  2392. you can populate the ring by adding elements into it manually. It is quite 
  2393. valid to add manually a query into a ring set up to be populated automatically. 
  2394.  
  2395. The ring does not allow duplicates so that, in the case of automatic addition, 
  2396. repeatedly running the same query, for example when using the auto-refresh 
  2397. option, does not cause it to be stored multiple times. The ring also does not 
  2398. allow blank entries. 
  2399.  
  2400. In order to preserve an environment in which several different queries are used 
  2401. in close association, all queries in the ring can be saved with the object. 
  2402. This option is again set from the History page of the SQL window settings 
  2403. notebook. The query that is displayed in the SQL window at the time of the save 
  2404. action is treated as the `primary' query for the object. When the object is 
  2405. subsequently activated the whole ring is re-loaded. 
  2406.  
  2407. You can have queries that have not yet been run in the ring. XY-Query 
  2408. automatically takes the query in the SQL window and places it in the ring 
  2409. whenever new queries are introduced by the Query Builder or Query Import. 
  2410.  
  2411. In the case of an Import from another XY-Query SQL, Viewer or Chart object, if 
  2412. the object has multiple queries itself then they will all be imported into the 
  2413. ring (minus duplicates) with the primary query from the source object becoming 
  2414. the current query in the SQL editor. 
  2415.  
  2416. To assist with the management of the ring there are five menu items. These 
  2417. options are displayed in the History submenu of the Query menu on the SQL 
  2418. window. Some of the options only become available when at least one item is in 
  2419. the ring. 
  2420.  
  2421.  Add         This enables the manual addition of the current query into the 
  2422.              History Ring, subject to the standard check for duplication. 
  2423.  Backwards / Forwards These options are only available if at least one query 
  2424.              has been placed in the ring. They enable the traversal of the 
  2425.              ring. When one of these options is selected the next, or previous, 
  2426.              query in the ring is displayed in the SQL window and the previous 
  2427.              contents of the SQL editor is moved on around the ring. These two 
  2428.              actions can also be invoked directly from the toolbar. 
  2429.  Remove      This option is only available if at least one query has been 
  2430.              placed in the ring. If this option is selected the current query 
  2431.              displayed in the SQL window is removed from the ring. If there are 
  2432.              other queries in the ring then the query that was notionally 
  2433.              behind it is displayed in the SQL editor. If there were no other 
  2434.              queries then the SQL editor is emptied and the ring rotation and 
  2435.              removal facilities become unavailable. 
  2436.  Remove All  This option is only available if at least one query has been 
  2437.              placed in the ring. It serves to remove all queries from the ring. 
  2438.              The ring rotation and removal facilities become unavailable. 
  2439.  
  2440.  The toolbar buttons allowing traversal of the ring are only visible when the 
  2441.  first query is placed in it. If all queries in the ring are subsequently 
  2442.  removed then the toolbar buttons will be removed. 
  2443.  
  2444.  
  2445. ΓòÉΓòÉΓòÉ 9.4.5. Printing queries ΓòÉΓòÉΓòÉ
  2446.  
  2447. To print the query currently displayed in the SQL editor open the File menu and 
  2448. select Print, or press the printer button on the toolbar. 
  2449.  
  2450. A dialog box displays a list of all available printers: 
  2451.  
  2452.      Select a printer from the list. 
  2453.      Press the Job button to display and change the job properties for this 
  2454.       printer as required. 
  2455.      Press the Print button to confirm the printing request. to print your 
  2456.       query. 
  2457.  
  2458.  XY-Query uses the OS/2 formatted print drivers installed on your system to 
  2459.  produce hardcopy output. 
  2460.  
  2461.  If you have a problem printing on a LAN connected printer where the printer 
  2462.  starts up when the job is submitted but no text appears, try the following: 
  2463.  
  2464.    1. Open the Settings for your desktop printer object. 
  2465.    2. Turn to the Queue options page. 
  2466.    3. Select the Printer-specific format option. 
  2467.  
  2468.  
  2469. ΓòÉΓòÉΓòÉ 9.4.6. Copying, cutting and pasting text ΓòÉΓòÉΓòÉ
  2470.  
  2471. You can copy and cut text from, and paste text into, the SQL editor using the 
  2472. OS/2 Clipboard. Before copying or cutting text, select it, either by holding 
  2473. the left mouse button and dragging the pointer over it, or by holding down the 
  2474. Shift key and using the arrow keys to move through the text. If all text in the 
  2475. SQL editor is required use the Select all option from the Edit menu. This will 
  2476. highlight all of the text in the SQL editor ready for Cut or Copy. 
  2477.  
  2478. To copy selected text, open the Edit menu and select Copy.  The text is copied 
  2479. to the Clipboard. 
  2480.  
  2481. To cut and copy selected text, open the Edit menu and select Cut. The text is 
  2482. deleted from the text area and copied to the Clipboard. 
  2483.  
  2484. To paste an item from the clipboard into the SQL editor, position the cursor at 
  2485. the point where you want the item to be inserted, open the Edit menu and select 
  2486. Paste. The item is pasted into the text area. 
  2487.  
  2488.  
  2489. ΓòÉΓòÉΓòÉ 9.4.7. Utilities from the SQL window ΓòÉΓòÉΓòÉ
  2490.  
  2491. The standard set of XY-Query utility functions are available from the SQL 
  2492. window. 
  2493.  
  2494. Some utilities are limited only to DB2/2 but others are open to all DB2 
  2495. databases and XDB. 
  2496.  
  2497.      Create a DB2/2 database (Create Database) 
  2498.      Erase a DB2/2 database (Erase Database) 
  2499.      Create, or append to, a DB2 or XDB table (Creating, or appending to a 
  2500.       table using Viewer data) 
  2501.      Define a new DB2 or XDB table (Defining a new table) 
  2502.      Erase a DB2 or XDB table (Erasing a table) 
  2503.      Create a DB2/2 table by importing a file (Importing a table) 
  2504.      Register and de-register logons and passwords (Managing sessions) 
  2505.  
  2506.  
  2507. ΓòÉΓòÉΓòÉ 9.4.8. SQL window functions whilst in builder view ΓòÉΓòÉΓòÉ
  2508.  
  2509. With the exception of the clipboard operations, all SQL window functions can be 
  2510. performed as normal when the SQL window is in its Builder view. However, for 
  2511. the functions concerned with extracting the current query from the SQL editor 
  2512. such as Save, Copy-To and Export, XY-Query will firstly construct a query as 
  2513. defined by the current state of the Builder panels and place it in the SQL 
  2514. editor. The operations can then continue as normal. 
  2515.  
  2516.  
  2517. ΓòÉΓòÉΓòÉ 9.5. SQL window settings ΓòÉΓòÉΓòÉ
  2518.  
  2519. Each SQL window has a Settings Notebook from where you can set the attributes 
  2520. and presentation styles for the window. You use the SQL window Settings 
  2521. Notebook to override the default settings for the appearance of the SQL window 
  2522. and those that affect query execution. 
  2523.  
  2524. You can display the notebook in three different ways: 
  2525.  
  2526.      Select the Open Settings option of the View menu 
  2527.      Press the Settings icon on the toolbar 
  2528.      Press the right hand mouse button when the pointer is over the SQL editor 
  2529.       or the location selector. 
  2530.  
  2531.  The SQL window Settings Notebook consists of six pages: 
  2532.  
  2533.      Presentation page 
  2534.      History page 
  2535.      Case page 
  2536.      Limits page 
  2537.      Wildcards page 
  2538.      Security page 
  2539.  
  2540.  Note:  In general all pages in a Settings notebook have Apply, Undo and 
  2541.  Default buttons as standard. The Apply button takes the current settings for 
  2542.  the page and applies them to the object. The Undo button sets the page 
  2543.  settings back to the state they were in at the time of the last apply. The 
  2544.  Default button causes the default settings to be reflected on the page. The 
  2545.  defaults can be application supplied or can be supplied by the XY-Query 
  2546.  Settings facility. These defaults will only be reflected in the object itself 
  2547.  if they are explicitly applied. 
  2548.  
  2549.  
  2550. ΓòÉΓòÉΓòÉ 9.5.1. Presentation page ΓòÉΓòÉΓòÉ
  2551.  
  2552. You use the Presentation Page to set the background and text colours for the 
  2553. SQL editor and the location selector. You can also set the font in which any 
  2554. text is displayed in the editor. 
  2555.  
  2556. SQL Settings - Presentation page 
  2557.  
  2558. To set the colours, press the button for the relevant area, then select a 
  2559. colour from the colour matrix. The small colour sample square to the right of 
  2560. the button changes to reflect the selection. 
  2561.  
  2562. To set the font for the text in the SQL editor, select a font name from the 
  2563. list of those available and then use the spin button to select the font size. 
  2564.  
  2565. The defaults for this page are retrieved from the SQL section of the XY-Query 
  2566. Settings facility as described in SQL Settings - Presentation page. 
  2567.  
  2568.  
  2569. ΓòÉΓòÉΓòÉ 9.5.2. History page ΓòÉΓòÉΓòÉ
  2570.  
  2571. You use the SQL History Page to determine the way in which the History Ring 
  2572. operates. 
  2573.  
  2574. SQL Settings - History page 
  2575.  
  2576. To save the History Ring with the object you must select the History Save 
  2577. option. Then you can decide upon the maximum number of queries that can be 
  2578. saved as the History for the object. 
  2579.  
  2580. To get XY-Query to automatically add a query into the History Ring when it has 
  2581. executed successfully, select the Add to History On Run option. If you have not 
  2582. selected this queries can only be added to the ring manually. 
  2583.  
  2584. The defaults for this page are retrieved from the SQL section of the XY-Query 
  2585. Settings facility as described in SQL Settings - History page. 
  2586.  
  2587.  
  2588. ΓòÉΓòÉΓòÉ 9.5.3. Case page ΓòÉΓòÉΓòÉ
  2589.  
  2590. You use the Case Page to select the case in which queries are submitted to the 
  2591. database. 
  2592.  
  2593. SQL Settings - Case page 
  2594.  
  2595. To set the Case attribute, press a button to specify whether: 
  2596.  
  2597.      The query text remains as typed 
  2598.      The query text is translated to lower case 
  2599.      The query text is translated to upper case 
  2600.  
  2601.  Setting this attribute has no effect on the visual display of the query in the 
  2602.  SQL editor. It only affects the internal representation of the query text as 
  2603.  it passed for execution. 
  2604.  
  2605.  The defaults for this page are retrieved from the SQL section of the XY-Query 
  2606.  Settings facility as described in SQL Settings - Defaults page. 
  2607.  
  2608.  
  2609. ΓòÉΓòÉΓòÉ 9.5.4. Limits page ΓòÉΓòÉΓòÉ
  2610.  
  2611. You use the Limits Page to set the character display limit and the row fetch 
  2612. limit for the object. 
  2613.  
  2614. SQL Settings - Limits page 
  2615.  
  2616.  Character limit Use this field to specify the maximum number of characters 
  2617.                  that are displayed in the Viewer when a column of any 
  2618.                  Character type is returned from a query issued by this object. 
  2619.  Fetch Limit     Use this field to specify the maximum number of rows which 
  2620.                  will be fetched by a query run from the object. The value can 
  2621.                  not be greater than the value set for Maximum Fetch Limit in 
  2622.                  the Limits page of the General section of XY-Query Settings 
  2623.                  facility. If there are more rows than this maximum, XY-Query 
  2624.                  displays a message explaining that the query has stopped as 
  2625.                  the fetch limit has been reached. If the extra data is 
  2626.                  required then the Maximum Fetch Limit must be increased before 
  2627.                  increasing the Fetch limit for the individual object. The 
  2628.                  query must then be re-run to retrieve the additional data. 
  2629.  
  2630.  The defaults for this page are retrieved from the General section of the 
  2631.  XY-Query Settings facility as described in General Settings - Limits page. 
  2632.  
  2633.  
  2634. ΓòÉΓòÉΓòÉ 9.5.5. Wildcards page ΓòÉΓòÉΓòÉ
  2635.  
  2636. SQL Settings - Wildcards page 
  2637.  
  2638. The Wildcards page allows you to specify values for table creators and table 
  2639. names that will act as wildcards to limit the amount of data retrieved into the 
  2640. Select Tables page of the Builder. 
  2641.  
  2642. The wildcards can be specified in various forms. If an exact match is required 
  2643. then the exact text should be entered, for example USERID. If a fuzzy match is 
  2644. required then the wildcard can be specified as for example U* or *SER*. 
  2645.  
  2646. Note:  The wildcard indicator can be either an asterisk ,* , or a percentage 
  2647. sign, %. 
  2648.  
  2649. When multiple wildcards are specified then creators or table names will be 
  2650. returned that match any of the wildcards. 
  2651.  
  2652. In addition to the wildcards it is possible to request that tables owned by you 
  2653. are returned. In order to reduce the list still further it is possible to 
  2654. request that only tables to which you have the correct authority, depending 
  2655. upon the type of query being built, be returned. 
  2656.  
  2657. When Apply is pressed the Select Tables page in the Builder will be 
  2658. automatically refreshed to take account of the selections. 
  2659.  
  2660.  Creators List       Use this to specify up to 40 wildcards to use to limit the 
  2661.                      number of entries returned into the Creators list of the 
  2662.                      Select Tables page in the builder. 
  2663.  Tables List         Use this to specify up to 40 wildcards to use to limit the 
  2664.                      number of entries returned into the Table names list of 
  2665.                      the Select Tables page in the builder. 
  2666.  List "My Tables"    Select this to ensure that tables owned by you are 
  2667.                      retrieved 
  2668.  List Granted Tables Only Select this to limit the list of tables returned to 
  2669.                      those for which you have the correct authority granted. 
  2670.  
  2671.  The defaults for this page are retrieved from the SQL section of the XY-Query 
  2672.  Settings facility as described in SQL Settings - Wildcards page. 
  2673.  
  2674.  
  2675. ΓòÉΓòÉΓòÉ 9.5.6. Security page ΓòÉΓòÉΓòÉ
  2676.  
  2677. SQL Settings - Security page 
  2678.  
  2679. The Security page allows you to apply security measures to your XY-Query Sql, 
  2680. Viewer and Chart objects. You can specify an individual object to be Write 
  2681. Protected, Read Protected or both. 
  2682.  
  2683. By making an object write protected you can prevent users of the object from 
  2684. saving changes they may have made, either accidentally or deliberately. 
  2685.  
  2686. Setting read protection prevents unauthorised users from opening or executing 
  2687. an object. 
  2688.  
  2689. Both levels of protection rely on the use of passwords. An object can have a 
  2690. read and a write protect password. It may be that they are both the same but 
  2691. they do not need to be. It is up to the creator of the object to determine what 
  2692. level of security it requires and what the passwords should be. 
  2693.  
  2694. To set a password perform the following activities: 
  2695.  
  2696.    1. Select the required security option from the list 
  2697.  
  2698.    2. Enter the required password 
  2699.  
  2700.    3. Repeat the password in the verification field 
  2701.  
  2702.    4. Press the Set button. 
  2703.  
  2704.    5. Press the Apply button (if all activity on the page is complete) 
  2705.  
  2706.  When you set write protection on it is initially in its de-activated state. 
  2707.  This is to allow you to continue changing the object. When all changes are 
  2708.  complete you may either explicitly save or close the object. Once these 
  2709.  actions are complete full write protection for the object is activated. This 
  2710.  would mean that no further changes can be written to the object file. 
  2711.  
  2712.  If you have a write protected object you can still change it if you know the 
  2713.  correct password. The way to do this is as follows: 
  2714.  
  2715.    1. Select the Write Protection security option from the list 
  2716.  
  2717.    2. Enter the write protect password 
  2718.  
  2719.    3. Press the De-Activate button. 
  2720.  
  2721.    4. Press the Apply button (if all activity on the page is complete) 
  2722.  
  2723.  This will temporarily de-activate write protection. This means that you can 
  2724.  make changes to the object and save them. The act of saving will re-activate 
  2725.  full write protection. 
  2726.  
  2727.  Setting read protection on will cause the object file to be encrypted as it is 
  2728.  stored thus making the file unreadable using normal text editors. 
  2729.  
  2730.  You can only open a read protected object if you know the correct password. 
  2731.  When you attempt to open a read protected object a dialog box will be 
  2732.  displayed prompting you for the read protect password. 
  2733.  
  2734.  Opening a read protected object 
  2735.  
  2736.  Entering the correct password here will then open the XY-Query object as 
  2737.  normal. If the password is incorrect then a warning is given and the object is 
  2738.  not opened. You have three attempts to enter the correct password before the 
  2739.  dialog will dismiss itself. 
  2740.  
  2741.  Note:  All passwords are case sensitive and retain any leading or trailing 
  2742.  spaces. 
  2743.  
  2744.  
  2745. ΓòÉΓòÉΓòÉ 10. Working with the Viewer window ΓòÉΓòÉΓòÉ
  2746.  
  2747.  
  2748. ΓòÉΓòÉΓòÉ 10.1. Introduction ΓòÉΓòÉΓòÉ
  2749.  
  2750. This chapter explains the functions available from the Viewer window and 
  2751. describes the Viewer settings notebook. 
  2752.  
  2753. For instructions on using charts to display your output, see chapter Working 
  2754. with the Chart window. 
  2755.  
  2756.  
  2757. ΓòÉΓòÉΓòÉ 10.2. Using the Viewer ΓòÉΓòÉΓòÉ
  2758.  
  2759. From the Viewer, the following facilities are available: 
  2760.  
  2761.      Direct Editing (Direct Editing) 
  2762.      Dynamic Table Updates (Table Update) 
  2763.      Save the current object (Saving from the Viewer) 
  2764.      Copy to an XY-Query object (Copying to an XY-Query object) 
  2765.      Data export (Exporting Viewer data to a file) 
  2766.      Find data (Finding data) 
  2767.      Place data in the OS/2 clipboard (Selecting items and clipboard support) 
  2768.      Plot a selected portion of the data to a chart (Plotting selected items 
  2769.       of data) 
  2770.      Print the contents of the display area (Printing the data in the Viewer) 
  2771.      Refresh the data displayed re-running the query (Refreshing the data in 
  2772.       the Viewer) 
  2773.      Utilities (Utilities from the Viewer) 
  2774.      Tailor the appearance of the Viewer using the Viewer settings (Viewer 
  2775.       window settings) 
  2776.  
  2777.  
  2778. ΓòÉΓòÉΓòÉ 10.2.1. Direct Editing ΓòÉΓòÉΓòÉ
  2779.  
  2780. Direct Editing is the term associated with the ability to directly manipulate 
  2781. elements of the report displayed in the Viewer without using the settings 
  2782. notebook. 
  2783.  
  2784. Updates are possible in both the Report and Form views but only when they are 
  2785. in update mode. 
  2786.  
  2787. The elements that can be updated are as follows: 
  2788.  
  2789.      Headings 
  2790.      Column Titles 
  2791.      Data 
  2792.      Footings 
  2793.  
  2794.  Note:  All in this list are directly editable from the Report view in update 
  2795.  mode, however the Form view only allows the direct edit of data. 
  2796.  
  2797.  Editing in Report view is achieved by means of an edit box which appears 
  2798.  around the cell in the report which has focus. When the edit box is over the 
  2799.  cell you would like to change, you can then manually edit its contents to what 
  2800.  you required. 
  2801.  
  2802.  Editing in Form view is achieved by enabling the fields displaying the data to 
  2803.  be updated. 
  2804.  
  2805.  When data is being updated edit checking is performed to ensure that the 
  2806.  edited value conforms to the definition of the column to which the data 
  2807.  relates. For example, it will not allow non-numeric characters in a numeric 
  2808.  column or values that breach the bounds of the column type. 
  2809.  
  2810.  Headings, footings and column titles can be updated directly within the Report 
  2811.  view in update mode at all times. However, data can only be directly edited, 
  2812.  in either view, depending upon the setting of the Data Update Page in the 
  2813.  Viewer settings notebook. It is possible from within here to disallow the 
  2814.  direct edit of data even if the Viewer is in update mode. 
  2815.  
  2816.  This page also controls whether or not any updates made to the data should be 
  2817.  reflected in the table from which the data was originally retrieved. The 
  2818.  ability to do this is termed Table Update (see Table Update) and is governed 
  2819.  by a number of conditions which must be met before it will be allowed. These 
  2820.  include that the query must only be selecting data from a single table and the 
  2821.  selected columns must not include expressions, constants or duplicates. 
  2822.  
  2823.  If you make a mistake when editing, or inadvertently change the wrong data, 
  2824.  you can restore the current cell to its original state before the edit was 
  2825.  initiated by selecting the Undo - Current Change menu item under the Edit 
  2826.  menu. 
  2827.  
  2828.  You can add or delete heading, footing and data rows directly in the Viewer. 
  2829.  These functions are all controlled from under the Edit menu of the Viewer. 
  2830.  
  2831.  To delete a row of any kind from the Report view the focus must be placed on 
  2832.  the line to be removed. In Form view the currently displayed data row will be 
  2833.  deleted. 
  2834.  
  2835.  To add a row within the Report view the focus must be placed upon another row 
  2836.  of the same type. It is then possible to add the new row immediately before or 
  2837.  after the row with focus. In Form view a new data row will be inserted after 
  2838.  or before the currently displayed row. It is important to note that if you are 
  2839.  employing Table Update, although you may enter a data row at a certain place 
  2840.  in the report it does not imply that this would be where it would appear next 
  2841.  time you run the query. The query must be written to ensure data is presented 
  2842.  to you in the sequence you require. 
  2843.  
  2844.  
  2845. ΓòÉΓòÉΓòÉ 10.2.2. Table Update ΓòÉΓòÉΓòÉ
  2846.  
  2847. Table Update is the term associated with the ability to reflect changes made to 
  2848. the data by Direct Editing, in the underlying table. 
  2849.  
  2850. A number of conditions must be met before Table Update is allowed. These 
  2851. include that the query must only be selecting data from a single table and the 
  2852. selected columns must not include expressions, constants or duplicates. 
  2853.  
  2854. There are four methods of Table Update that can be used. The choice is made 
  2855. from the Data Update Page of the Viewer settings notebook, see Data Update 
  2856. page. 
  2857.  
  2858. If the choice is Update Table By Cell, By Row or By Block then the updates 
  2859. requests will be sent automatically by XY-Query 
  2860.  
  2861. Alternatively, the changes can be grouped and pended until the user is ready to 
  2862. issue them to the table. This is termed Update Table On Request. 
  2863.  
  2864. The automatic sending of update requests is triggered when XY-Query detects 
  2865. that focus has moved and the issue threshold has been reached. This may be one 
  2866. cell, one row or a number of rows. 
  2867.  
  2868. It is still possible to send updates through on request even if one of the 
  2869. automatic options has been selected. This is achieved by using the Apply 
  2870. Pending Changes option of the Edit menu or the associated toolbar button. 
  2871.  
  2872. When changes have been made to the data in the Viewer, but the table update 
  2873. requests have not yet been issued, the changed data will be displayed in the 
  2874. foreground colour of the update region as specified in the Presentation page of 
  2875. the Viewer settings notebook. As the updates are processed and confirmation is 
  2876. received from the database, the colour is changed back to the normal data 
  2877. region colour. 
  2878.  
  2879. If you have a number of pending changes you can cancel them and restore the 
  2880. data to its original state by selecting the Undo - Pending Changes menu item 
  2881. under the Edit menu. 
  2882.  
  2883.  
  2884. ΓòÉΓòÉΓòÉ 10.2.3. Saving from the Viewer ΓòÉΓòÉΓòÉ
  2885.  
  2886. To perform a save, open the File menu and select Save. This saves all 
  2887. information about the three windows associated with the current object, namely 
  2888. the Viewer, SQL and Chart windows. It does not affect the type of object. You 
  2889. can validly request a save from the Viewer even if the current object is an SQL 
  2890. or Chart object. 
  2891.  
  2892.  
  2893. ΓòÉΓòÉΓòÉ 10.2.4. Copying to an XY-Query object ΓòÉΓòÉΓòÉ
  2894.  
  2895. To create a copy of the current XY-Query object, open the File menu of the 
  2896. Viewer and select Copy to.... 
  2897.  
  2898. The dialog box displayed has the same appearance as the one used for copying or 
  2899. exporting from the SQL window (Copy-To dialog box). 
  2900.  
  2901. The formats available for copying are: 
  2902.  
  2903.      XYViewer 
  2904.      XYQuery 
  2905.      XYChart 
  2906.  
  2907.  Select a format, then specify a file name and path.  A new XY-Query object of 
  2908.  the type specified is created, identical, in all but name, to the current 
  2909.  state of the active object. 
  2910.  
  2911.  
  2912. ΓòÉΓòÉΓòÉ 10.2.5. Exporting Viewer data to a file ΓòÉΓòÉΓòÉ
  2913.  
  2914. To export the data shown in the Viewer, open the Viewer menu of the Viewer and 
  2915. select Export.... 
  2916.  
  2917. The dialog box displayed has the same appearance as the one used for copying or 
  2918. exporting from the SQL window as shown in Copy-To dialog box. 
  2919.  
  2920. The file formats available for exporting are: 
  2921.  
  2922.            Import Export Format       (.IXF)
  2923.  
  2924.            Plain Text                 (.TXT)
  2925.  
  2926.            Comma Separated Variable   (.CSV)
  2927.  
  2928.            ASCII Delimited Files      (.DEL)
  2929.  
  2930.            DIF Standard               (.DIF)
  2931.  
  2932.            Standard DIF with headings (.DIF)
  2933.  
  2934.            DIF Extended               (.DIF)
  2935.  
  2936.            Lotus 1-2-3 spreadsheet    (.WSF)
  2937.  
  2938.  You select a format and then specify a file name and path. 
  2939.  
  2940.  For export operations to text (.TXT), the resultant file contains the data 
  2941.  from the Viewer together with any changes made using the Settings option (see 
  2942.  Viewer window settings). 
  2943.  
  2944.  Export operations to Data Interchange Format (.DIF) , Import Export Format 
  2945.  (.IXF), Delimited ASCII Format (.DEL or .CSV) or Worksheet Format (.WSF) do 
  2946.  not reflect headings, footings or column usage settings (see Viewer window 
  2947.  settings). 
  2948.  
  2949.  Note:  You can change the ASCII delimiters for .DEL and .CSV files using the 
  2950.  Export page of the Viewer section of the XY-Query Settings facility (see 
  2951.  Viewer Settings - Export page). 
  2952.  
  2953.  
  2954. ΓòÉΓòÉΓòÉ 10.2.6. Finding data ΓòÉΓòÉΓòÉ
  2955.  
  2956. To search for a string of characters, open the Edit menu and select Find, or 
  2957. press the appropriate button on the toolbar to display the Find dialog box. 
  2958.  
  2959. Viewer Search dialog 
  2960.  
  2961. Type the search string in the Search field, select any required options and 
  2962. press the Find button.  The options available are: 
  2963.  
  2964.  Column          Select the column to search from the pulldown. 
  2965.  Ignore case     Find the required characters irrespective of case, for example 
  2966.                  Sales  or SALES. 
  2967.  Search wrap     If a forward search reaches the end of the report, continue 
  2968.                  the search by wrapping round to the beginning.  Similarly, if 
  2969.                  a reverse search reaches the beginning of the report, wrap 
  2970.                  round to the end. 
  2971.  Reverse search  Search the report backwards, from the cursor position towards 
  2972.                  the beginning of the report. 
  2973.  
  2974.  Note:  The next cell containing the data is found.  If there is another 
  2975.  instance of the search string in the same cell, a subsequent Find ignores it 
  2976.  and goes on to the next cell containing the string. 
  2977.  
  2978.  To search for the next occurrence of the string, press the Find button again. 
  2979.  Alternatively, open the Edit menu and select Find next, or press the 
  2980.  appropriate button on the toolbar. 
  2981.  
  2982.  Note: 
  2983.  
  2984.    1. The search starts at the current position of the cursor in the Viewer 
  2985.       display and stops at the beginning or end unless the Search Wrap option 
  2986.       is selected. To search the whole report, select this option or start from 
  2987.       the beginning or end. Once search parameters have been established, the 
  2988.       Find Next option can be used to find the next occurrence of the string. 
  2989.    2. To set the search start position simply click in the Viewer at the 
  2990.       required position. If the Viewer did not previously have the focus, 
  2991.       double-click the mouse button. 
  2992.  
  2993.  
  2994. ΓòÉΓòÉΓòÉ 10.2.7. Selecting items and clipboard support ΓòÉΓòÉΓòÉ
  2995.  
  2996. When the Viewer is in Report view and update mode, rows of data can be selected 
  2997. by clicking with the left mouse-button on the graphic buttons to the left of 
  2998. them, and columns by clicking on the buttons above them. To select a cell, 
  2999. click on the small button to its left. 
  3000.  
  3001. By holding the shift key while selecting data, a range of data can be selected. 
  3002. By holding the control key while selecting data, more data can be selected 
  3003. without de-selecting the previously selected data - in this way, several 
  3004. separate areas can be marked. 
  3005.  
  3006. The Select All option under the Edit menu marks all data in the Viewer. 
  3007.  
  3008. The availability of the clipboard operations in the Viewer depend upon which 
  3009. mode it is in. 
  3010.  
  3011. When the Viewer is in browse mode, irrespective of view, only the Copy function 
  3012. may be used. 
  3013.  
  3014. Full clipboard support can be used when the Viewer is in update mode. 
  3015.  
  3016. To copy any marked text to the clipboard, open the Edit menu of the Viewer and 
  3017. select Copy or use the CTRL+INSERT key combination. 
  3018.  
  3019. To move any marked text to the clipboard, open the Edit menu of the Viewer and 
  3020. select Cut or use the Shift+Delete key combination. 
  3021.  
  3022. To paste text into the Viewer from the clipboard, open the Edit menu of the 
  3023. Viewer and select Paste or use the Shift+Insert key combination. 
  3024.  
  3025.  
  3026. ΓòÉΓòÉΓòÉ 10.2.8. Plotting selected items of data ΓòÉΓòÉΓòÉ
  3027.  
  3028. To plot specific items of data to a chart: 
  3029.  
  3030.    1. Place the Viewer in Report view and Update mode. 
  3031.    2. Mark the data to be plotted in the Viewer. 
  3032.    3. Open the Selected menu and select Plot to Chart. 
  3033.  
  3034.  Note:  The Plot To Chart option is only available if the marked areas of the 
  3035.  Viewer data are suitable for plotting. 
  3036.  
  3037.  
  3038. ΓòÉΓòÉΓòÉ 10.2.9. Printing the data in the Viewer ΓòÉΓòÉΓòÉ
  3039.  
  3040. To print the data displayed in the Viewer, open the File menu and select Print, 
  3041. or press the printer button on the toolbar. 
  3042.  
  3043. A dialog box is displayed showing a list of all available printers: 
  3044.  
  3045. The dialog box is used to specify the printer on which to print the report. The 
  3046. dialog should be used as follows. 
  3047.  
  3048.      Select a printer from the list. 
  3049.      Press the Job button to display and change the job properties for this 
  3050.       printer as required.. 
  3051.      Press the Print button to confirm the printing request. 
  3052.  
  3053.  Note:  The Viewer only prints the Report view, in either mode. Print requests 
  3054.  made from Form view will cause the report view to be printed. 
  3055.  
  3056.  XY-Query uses the OS/2 formatted print drivers installed on your system to 
  3057.  produce hardcopy output. 
  3058.  
  3059.  If you have a problem printing on a LAN connected printer where the printer 
  3060.  starts up when the job is submitted but no text appears, try the following: 
  3061.  
  3062.    1. Open the Settings for your printer object. 
  3063.    2. Turn to the Queue options page. 
  3064.    3. Select the Printer-specific format option. 
  3065.  
  3066.  
  3067. ΓòÉΓòÉΓòÉ 10.2.10. Refreshing the data in the Viewer ΓòÉΓòÉΓòÉ
  3068.  
  3069. If you want to refresh the data in the Viewer, you must re-run the query. You 
  3070. do this from the SQL window or by selecting the Refresh now option from the 
  3071. Viewer menu. 
  3072.  
  3073. You can stop a query that is running by selecting the Stop option from the 
  3074. Viewer menu. The data retrieved so far is shown in the Viewer. 
  3075.  
  3076. You can request that the data in the Viewer is continually refreshed thus 
  3077. reflecting dynamically any changes to the database. The query is re-run after a 
  3078. pre-defined delay. 
  3079.  
  3080. To specify that the data is automatically refreshed, open the Viewer menu and 
  3081. select AutoRefresh. To terminate auto-refreshing, repeat this action. 
  3082.  
  3083. You can define the auto-refresh interval in the Timings page in the XY-Query 
  3084. Settings facility. See Using the XY-Query settings facility. 
  3085.  
  3086. Note:  The Viewer is subject to auto-refresh even if the request was issued 
  3087. from the Chart window.  When the query is re-run XY-Query, refreshes all data 
  3088. display windows that are visible. 
  3089.  
  3090.  
  3091. ΓòÉΓòÉΓòÉ 10.2.11. Utilities from the Viewer ΓòÉΓòÉΓòÉ
  3092.  
  3093. The standard set of XY-Query utility functions are available from the Viewer. 
  3094.  
  3095. Some utilities are limited only to DB2/2 but others are open to all DB2 
  3096. databases and XDB. 
  3097.  
  3098.      Create a DB2/2 database (Create Database) 
  3099.      Erase a DB2/2 database (Erase Database) 
  3100.      Create, or append to, a DB2 or XDB table (Creating, or appending to a 
  3101.       table using Viewer data) 
  3102.      Define a new DB2 or XDB table (Defining a new table) 
  3103.      Erase a DB2 or XDB table (Erasing a table) 
  3104.      Create a DB2/2 table by importing a file (Importing a table) 
  3105.      Register and de-register logons and passwords (Managing sessions) 
  3106.  
  3107.  
  3108. ΓòÉΓòÉΓòÉ 10.3. Viewer window settings ΓòÉΓòÉΓòÉ
  3109.  
  3110. Each Viewer window has a Settings Notebook from where you can set the 
  3111. attributes and presentation styles for the window. The Viewer window settings 
  3112. notebook enables you to override the default settings for the appearance of the 
  3113. Viewer window as well as giving great scope for tailoring the report currently 
  3114. being displayed. 
  3115.  
  3116. You can open the Viewer settings notebook in several ways. It can be requested 
  3117. by selecting the Open Settings option of the View menu, or by pressing the 
  3118. Settings button on the toolbar. Both of these methods display the notebook in 
  3119. its default state with the first page at the top. 
  3120.  
  3121. You can however, open the notebook at a specific page with certain fields 
  3122. pre-selected. This can be achieved by pressing the right hand mouse button 
  3123. either on its own or in conjunction with the CTRL key whilst the mouse pointer 
  3124. is over certain regions in the Viewer window. 
  3125.  
  3126. A right hand mouse click over data, total, button and line regions causes the 
  3127. columns page of the notebook to be pre-selected with the name field set to the 
  3128. name of the column (or closest column) in which the mouse was clicked. A right 
  3129. hand mouse click over a heading or footing opens the notebook at either the 
  3130. Headings or Footings page with the details of the line over which the mouse was 
  3131. clicked, pre-filled. If the mouse click is performed over a column title then 
  3132. the Titles page is pre-selected and the details of the selected column title 
  3133. pre-filled. 
  3134.  
  3135. If the CTRL button is held down at the same time as the right hand mouse button 
  3136. is pressed then the presentation page of the notebook is pre-selected. The 
  3137. presentation details of the region over which the mouse was clicked are 
  3138. pre-filled. 
  3139.  
  3140. The Viewer window Settings Notebook consists of eleven pages as follows: 
  3141.  
  3142.      Columns page 
  3143.      Titles page 
  3144.      Country page 
  3145.      Date/Time page 
  3146.      Subset page 
  3147.      Fix page 
  3148.      Break page 
  3149.      Headings page 
  3150.      Footings page 
  3151.      Presentation page 
  3152.      Data Update page 
  3153.  
  3154.  Note:  In general all pages in a Settings notebook have Apply, Undo and 
  3155.  Default buttons as standard. The Apply button takes the current settings for 
  3156.  the page and applies them to the object. The Undo button sets the page 
  3157.  settings back to the state they were in at the time of the last apply. The 
  3158.  Default button causes the default settings to be reflected on the page. The 
  3159.  defaults can be application supplied or can be supplied by the XY-Query 
  3160.  Settings facility. These defaults will only be reflected in the object itself 
  3161.  if they are explicitly applied. 
  3162.  
  3163.  
  3164. ΓòÉΓòÉΓòÉ 10.3.1. Columns page ΓòÉΓòÉΓòÉ
  3165.  
  3166. You use the Columns page to view and set the attributes for the data columns 
  3167. displayed in the Viewer. 
  3168.  
  3169. Viewer Settings - Columns page 
  3170.  
  3171. You can display the Columns page by positioning the mouse pointer over a 
  3172. specific data column and then pressing the right hand button.  The columns page 
  3173. is presented with the Name field set to the column pointed to and the attribute 
  3174. fields showing the current settings for that column. 
  3175.  
  3176. Use the Columns Page as follows: 
  3177.  
  3178.  Name       Select a column to format from this pulldown, or use the spin 
  3179.             button to select a column. The entries made in the Usage, Width, 
  3180.             Alignment and Position fields are applied to the selected column 
  3181.             when the Apply button is pressed.  Another column can then be 
  3182.             selected and changed in the same way. 
  3183.  Usage      Select the arithmetic or report function to be performed on the 
  3184.             data in the column. The possible functions are: 
  3185.             SUM           Total value 
  3186.             AVG           Average value 
  3187.             MIN           Minimum value 
  3188.             MAX           Maximum value 
  3189.             COUNT         Count of non-null entries 
  3190.             GROUP         Group rows of report on the column 
  3191.             ACROSS        Base an Across report on this column. Only one column 
  3192.                           can have this usage. Selecting it for a second column 
  3193.                           will automatically remove it from the original. 
  3194.  Alignment  Use this field to specify the alignment (Right, Left or Centre) of 
  3195.             the data in the column when it is displayed. 
  3196.  Width      Use this field to specify the maximum number of characters that the 
  3197.             column can display. Reducing this number beyond the original value 
  3198.             can cause  the display of the data to be truncated. 
  3199.  Position   Use this field to specify the position of the column in the 
  3200.             display, where 1 represents the column on the extreme left, 2 
  3201.             represents the column immediately to the right of it, and so on. 
  3202.             Any new positions are automatically reflected in the sequence 
  3203.             numbers in the Subset page. 
  3204.  
  3205.  
  3206. ΓòÉΓòÉΓòÉ 10.3.2. Titles page ΓòÉΓòÉΓòÉ
  3207.  
  3208. You use the Titles page to view and set the names of the data columns displayed 
  3209. in the Viewer. 
  3210.  
  3211. Viewer Settings - Titles page 
  3212.  
  3213. You can display the Titles Page by positioning the mouse pointer over a 
  3214. specific column title and then pressing the right hand button.  The page is 
  3215. presented with the Name field set to the column pointed to and the attribute 
  3216. fields showing the current settings for that column title. 
  3217.  
  3218. Use the Titles Page as follows: 
  3219.  
  3220.  Name       Select a column title to format from this pulldown or use the spin 
  3221.             button to select a column title. The entries made in the Data and 
  3222.             Alignment fields are applied to the selected column title when the 
  3223.             Apply button is pressed.  Another column can then be selected and 
  3224.             changed in the same way. 
  3225.  Data       Use this field to specify the new text for the column title. This 
  3226.             field is limited to 18 characters. If you want the title to be on 
  3227.             multiple lines, then separate the text using the Underscore 
  3228.             character. For example, enter DATE_OF_BIRTH to split the title over 
  3229.             three lines. 
  3230.  
  3231.             Note:  Underneath this field is an information field showing the 
  3232.             actual name of the column as defined in the database. 
  3233.  Alignment  Use this field to specify the alignment (Right, Left or Centre) of 
  3234.             the column title in the column when it is displayed. 
  3235.  
  3236.  You can also change the title of a column by directly editing it on the 
  3237.  Viewer. Any changes you make in this fashion will be dynamically reflected in 
  3238.  this page. 
  3239.  
  3240.  
  3241. ΓòÉΓòÉΓòÉ 10.3.3. Country page ΓòÉΓòÉΓòÉ
  3242.  
  3243. You use the Country page to specify Country specific formatting details for 
  3244. columns containing numeric data in the Viewer. 
  3245.  
  3246. Viewer Settings - Country page 
  3247.  
  3248. In its default state it reflects the settings defined in the XY-Query Settings 
  3249. facility.  Any changes made in this notebook are limited to the current object 
  3250. and do not affect the global settings. 
  3251.  
  3252. Complete the Country page as follows: 
  3253.  
  3254.  Name            Select a column to format from this pulldown, or use the spin 
  3255.                  button to select. 
  3256.  Currency        Enter the symbol to be used to show monetary values in the 
  3257.                  column. Use the Prefix, Suffix and None radio buttons to 
  3258.                  determine if the value is to be displayed in monetary terms 
  3259.                  and if so should the symbol precede or follow the value. 
  3260.  1000's separator Use the pulldown to select a thousands separator for the 
  3261.                  column. Use a comma to display the number one thousand as 
  3262.                  1,000, or a period for 1.000. 
  3263.  Decimal separator Use the pulldown to select a separator for decimals in the 
  3264.                  column. Use a period to show one and a half as 1.5 or a comma 
  3265.                  for 1,5. 
  3266.  Decimal Places  Use this field to specify the maximum number of digits that 
  3267.                  are displayed after the separator for decimal values in the 
  3268.                  column. If this is, for example, set to 2 then the value 
  3269.                  15.2948 is displayed as 15.29. Data displayed in the column is 
  3270.                  rounded when the decimal places are reduced. 
  3271.  Display Scientific Select this option to display Exponential numbers in 
  3272.                  Scientific notation. If it is not selected they will be 
  3273.                  displayed as decimal values. 
  3274.  Override database settings Use this field to decide whether to show the data 
  3275.                  in the column in its raw form as returned from the table or 
  3276.                  tailored according to the settings on this page. If this field 
  3277.                  is not selected then the settings are NOT used. 
  3278.  
  3279.  The defaults for this page are retrieved from the General section of the 
  3280.  XY-Query Settings facility. See General Settings - Language page for more 
  3281.  information. 
  3282.  
  3283.  
  3284. ΓòÉΓòÉΓòÉ 10.3.4. Date/Time page ΓòÉΓòÉΓòÉ
  3285.  
  3286. You use the Date/Time page to specify Country specific date and time formatting 
  3287. details to be used for columns containing dates or times in the Viewer. 
  3288.  
  3289. In its default state, this page reflects the settings defined in the XY-Query 
  3290. Settings facility. 
  3291.  
  3292. Any changes made in this notebook are limited to the current object and do not 
  3293. affect the global settings. 
  3294.  
  3295. Complete the Date / Time page as follows: 
  3296.  
  3297.  Name                Select a column to format from this pulldown, or use the 
  3298.                      spin button to select. 
  3299.  Date format - format Use the pulldown to choose a date format for the column. 
  3300.                      The available options are Day Month Year , Month Day Year 
  3301.                      or Year Month Day. 
  3302.  Date separator      Use the field and spin button to choose a date separator 
  3303.                      for the column. Use a hyphen if dates are to be displayed 
  3304.                      like 17-06-95. 
  3305.  Time format - format Use the pulldown to choose a time format for the column. 
  3306.                      The available options are 12- or 24-hour clock , am and pm 
  3307.                      etc.. 
  3308.  Time separator      Use the field and spin button to choose a time separator 
  3309.                      for the column. For example, a colon if times are to be 
  3310.                      displayed like 07:30. 
  3311.  Override database settings Use this field to decide whether to show the data 
  3312.                      in the column in its raw form as returned from the table 
  3313.                      or tailored according to the settings on this page. If 
  3314.                      this field is not selected then the settings are NOT used. 
  3315.  
  3316.  The defaults for this page are retrieved from the General section of the 
  3317.  XY-Query Settings facility. See General Settings - Date / Time page for more 
  3318.  information. 
  3319.  
  3320.  
  3321. ΓòÉΓòÉΓòÉ 10.3.5. Subset page ΓòÉΓòÉΓòÉ
  3322.  
  3323. You use the Subset Page to determine which columns are displayed in the Viewer. 
  3324.  
  3325. Viewer Settings - Subset page 
  3326.  
  3327. The Subset page can also be displayed by opening the View menu of the Viewer 
  3328. and selecting Subset columns.... 
  3329.  
  3330. Use the Subset page as follows: 
  3331.  
  3332.  Column list   This lists all the columns available to be displayed. In its 
  3333.                default state, all are selected. Columns that are currently 
  3334.                selected to appear in the Viewer are highlighted.  Select and 
  3335.                de-select columns by clicking on the columns in the list. Each 
  3336.                selected column has a number indicating its position from left 
  3337.                to right across the report.  Each new column selected is 
  3338.                assigned the next available number in ascending order. 
  3339.  
  3340.                To change the sequence numbers, de-select the columns and 
  3341.                reselect them in the required order. Any new sequencing is 
  3342.                automatically reflected in the Position field of the Columns 
  3343.                page. 
  3344.  Select All    Select all columns in the list.  Sequence numbers of columns not 
  3345.                already selected are assigned from top to bottom of the list. 
  3346.  Deselect All  De-select all columns in the list. 
  3347.  
  3348.  Changes made in this page affect several other pages. For example, if a column 
  3349.  is de-selected from this page it will no longer be available in the Columns, 
  3350.  Titles, Country, Date/Time, Fix or Break pages. 
  3351.  
  3352.  
  3353. ΓòÉΓòÉΓòÉ 10.3.6. Fix page ΓòÉΓòÉΓòÉ
  3354.  
  3355. You can display the Fix page by opening the View menu of the Viewer and 
  3356. selecting Fix columns.... The Fix page has the same general appearance as the 
  3357. Subset page. 
  3358.  
  3359. You use the Fix Page to anchor columns to the left of the Viewer display area. 
  3360. These columns are then non-scrollable horizontally. Only any remaining 
  3361. non-anchored columns can be scrolled. 
  3362.  
  3363. Complete the Fix page as follows: 
  3364.  
  3365.  Column list   This lists all of the columns currently displayed. Only those 
  3366.                columns that have been selected in the Subset page are 
  3367.                available.  Columns that are currently fixed are highlighted. 
  3368.  
  3369.                Select and de-select columns by clicking on the columns in the 
  3370.                list.  Each selected column is allocated a number indicating the 
  3371.                columns position from left to right across the fixed portion of 
  3372.                the Viewer.  Each new column selected is assigned the next 
  3373.                available number. To change the sequence, de-select the columns 
  3374.                and select them in the required order. 
  3375.  Select All    Select all columns in the list. Sequence numbers of columns not 
  3376.                already selected are assigned from top to bottom of the list. 
  3377.  Deselect All  Deselect all columns in the list. 
  3378.  
  3379.  
  3380. ΓòÉΓòÉΓòÉ 10.3.7. Break page ΓòÉΓòÉΓòÉ
  3381.  
  3382. You can display the Break page by opening the View menu of the Viewer and 
  3383. selecting Break columns.... 
  3384.  
  3385. Viewer Settings - Break page 
  3386.  
  3387. You use the Break Page to specify the columns on which the report will break 
  3388. after a change in value. 
  3389.  
  3390. Complete the Break page as follows: 
  3391.  
  3392.  Column list   This lists all the columns currently displayed.  Only those 
  3393.                columns that have been selected in the Subset page are 
  3394.                available. The columns used to break the report are highlighted. 
  3395.  
  3396.                Select and de-select columns by clicking on the columns in the 
  3397.                list.  Each selected column is allocated a number indicating the 
  3398.                order in which the breaks are actioned. Each new column selected 
  3399.                is assigned the next available number.  To change the sequence 
  3400.                numbers, de-select the columns and select them in the required 
  3401.                order. 
  3402.  Select All    Select all columns in the list.  Sequence numbers of columns not 
  3403.                already selected are assigned from top to bottom of the list. 
  3404.  Deselect All  De-select all columns in the list. 
  3405.  Break data on totals If this is selected and the report includes breaks, then 
  3406.                the data values on which the report breaks will be dropped onto 
  3407.                the totals line. 
  3408.  Totals only   If this is selected then the report will only show total lines. 
  3409.  
  3410.  The break data on totals and totals only options have the effect of altering 
  3411.  the displayed report to make it more concise and/or more informative. 
  3412.  
  3413.  For example, a fragment of a report giving salary totals by department may 
  3414.  display data as follows: 
  3415.  
  3416.   10       Mgr     22,959.20
  3417.            Mgr     20,010.00
  3418.            Mgr     19,260.25
  3419.            Mgr     21,234.00
  3420.                    83,463.45
  3421.   15       Clerk   12,508.20
  3422.            Clerk   12,258.50
  3423.            Mgr     20,659.80
  3424.            Sales   16,502.83
  3425.                    61,929.33
  3426.  
  3427.  When the data is viewed in Report view/read only mode the break data is not 
  3428.  repeated. This means that it may not be very easy to see which break values 
  3429.  relate to which sub-total. 
  3430.  
  3431.  If the option to show Break data on totals is selected then the above report 
  3432.  fragment would change as follows: 
  3433.  
  3434.   DEPT     JOB     SALARY
  3435.   10       Mgr     22,959.20
  3436.            Mgr     20,010.00
  3437.            Mgr     19,260.25
  3438.            Mgr     21,234.00
  3439.   10               83,463.45
  3440.   15       Clerk   12,508.20
  3441.            Clerk   12,258.50
  3442.            Mgr     20,659.80
  3443.            Sales   16,502.83
  3444.   15               61,929.33
  3445.  
  3446.  If you select Totals only the report described above could be condensed to 
  3447.  only show the total lines (sub- totals and grand totals) as follows: 
  3448.  
  3449.   DEPT    SALARY
  3450.           83,463.45
  3451.           61,929.33
  3452.           64,286.10
  3453.           77,285.55
  3454.           58,369.05
  3455.           86,090.80
  3456.           86,076.20
  3457.           66,147.00
  3458.           583,647.48
  3459.  
  3460.  This in itself may not be exactly what you required, but when it is used in 
  3461.  conjunction with the Break data on totals option a more useful report may be 
  3462.  displayed, as follows: 
  3463.  
  3464.   DEPT    SALARY
  3465.   10      83,463.45
  3466.   15      61,929.33
  3467.   20      64,286.10
  3468.   38      77,285.55
  3469.   42      58,369.05
  3470.   51      86,090.80
  3471.   66      86,076.20
  3472.   84      66,147.00
  3473.           583,647.48
  3474.  
  3475.  
  3476. ΓòÉΓòÉΓòÉ 10.3.8. Headings page ΓòÉΓòÉΓòÉ
  3477.  
  3478. You use the Headings Page to specify up to twenty lines of heading text which 
  3479. are displayed above the data at the top of the report. 
  3480.  
  3481. Viewer Settings - Headings page 
  3482.  
  3483. You can display the Headings Page by positioning the mouse pointer over a 
  3484. heading and then clicking the right hand button.  The Headings page is 
  3485. displayed with the fields pre-filled with the attributes of the heading line 
  3486. clicked. 
  3487.  
  3488. Complete the Headings page as follows: 
  3489.  
  3490.  Heading    Use this field to view the current lines of heading text. In 
  3491.             conjunction with the Text and Position fields you can amend an 
  3492.             existing heading or add a new one.  All headings can be viewed by 
  3493.             pulling down the list. Select the heading line from this field and 
  3494.             then write the text of the heading in the Text field below. 
  3495.  Text       Use this field to enter or update the text of the heading line. 
  3496.  Alignment  Use this to Right, Left or Centre align the heading line. 
  3497.  Position   Use the spin button to change the position of the heading line. 
  3498.             For example, changing the number from 3 to 1 makes the heading 
  3499.             currently on line 3, the top heading line. The headings originally 
  3500.             on lines 1 and 2 are automatically moved to lines 2 and 3 
  3501.             respectively. 
  3502.  
  3503.  Note: 
  3504.  
  3505.    1. You must press Apply after entering each heading line in order to 
  3506.       register it. 
  3507.    2. .You can also change the the text of a heading line by directly editing 
  3508.       it on the Viewer. Any changes you make in this fashion will be 
  3509.       dynamically reflected in this page. 
  3510.    3. Within a line of heading text, you can specify variables for which a 
  3511.       value will be substituted at run time. If the current date is required in 
  3512.       the heading enter &date in the text area.  Similarly, enter &time to show 
  3513.       the time at which the data was produced. Also, any other substitution 
  3514.       variables known to XY-Query can be specified. These can be variables 
  3515.       specified in the query that has run or one set by a previous query.  See 
  3516.       General Settings - Variables page for more information. 
  3517.  
  3518.  
  3519. ΓòÉΓòÉΓòÉ 10.3.9. Footings page ΓòÉΓòÉΓòÉ
  3520.  
  3521. You use the Footings Page to specify up to twenty lines of footing text which 
  3522. are displayed below the data at the bottom of the report. 
  3523.  
  3524. Viewer Settings - Footings page 
  3525.  
  3526. You can display the Footings Page by positioning the mouse pointer over a 
  3527. heading and then pressing the right hand button.  The Footings page appears 
  3528. with the fields pre-filled with the attributes of the footing line clicked. 
  3529.  
  3530. Complete the Footings page as follows: 
  3531.  
  3532.  Footing    Use this field to view the current lines of footing text. In 
  3533.             conjunction with the Text and Position fields, you can amend an 
  3534.             existing footing or add a new one.  All footings can be displayed 
  3535.             by pulling down the list.  Select the footing line in this field 
  3536.             and then write the text of the footing in the Text field below. 
  3537.  Text       Use this field to enter or update the text of the footing line. 
  3538.  Alignment  Use this to Right, Left or Centre align the footing line. 
  3539.  Position   Use the spin button to change the position of the footing line. 
  3540.             For example, changing the number from 3 to 1 makes the footing 
  3541.             currently on line 3, the first footing line. The footings 
  3542.             originally on lines 1 and 2 are automatically moved to lines 2 and 
  3543.             3 respectively. 
  3544.  
  3545.  Note: 
  3546.  
  3547.    1. You must press Apply after entering each footing line in order to 
  3548.       register it. 
  3549.    2. .You can also change the the text of a footing line by directly editing 
  3550.       it on the Viewer. Any changes you make in this fashion will be 
  3551.       dynamically reflected in this page. 
  3552.    3. Within a line of footing text, you can specify variables for which a 
  3553.       value will be substituted at run time. If the current date is required in 
  3554.       the footing enter &date in the text area.  Similarly, enter &time to show 
  3555.       the time at which the data was produced. Also, any other substitution 
  3556.       variables known to XY-Query can be specified. These can be variables 
  3557.       specified in the query that has run or one set by a previous query. See 
  3558.       General Settings - Variables page for more information. 
  3559.    4. The Footings page has the same general appearance as the Headings  page. 
  3560.  
  3561.  
  3562. ΓòÉΓòÉΓòÉ 10.3.10. Presentation page ΓòÉΓòÉΓòÉ
  3563.  
  3564. You use the Presentation page to specify fonts and colours for the various 
  3565. regions of the Viewer display area. 
  3566.  
  3567. Viewer Settings - Presentation page 
  3568.  
  3569. You can display the Presentation Page by positioning the mouse pointer over a 
  3570. specific region in the Viewer, and then pressing the right hand button while 
  3571. holding down the Ctrl key. The Presentation page is displayed with the fields 
  3572. pre-filled with the attributes of the region over which the mouse was clicked. 
  3573.  
  3574. The defaults for this page are retrieved from the Viewer section of the 
  3575. XY-Query Settings facility. In its default state it reflects the settings 
  3576. defined in the XY-Query Settings facility. Any changes made in this notebook 
  3577. are limited to the current object and do not affect the global settings. See 
  3578. Viewer Settings - Presentation page for more information. 
  3579.  
  3580. Note:  You can also use the OS/2 fonts and colours facilities for this. Drag 
  3581. the font or colour to the required part of the report.  If the control key is 
  3582. held while dragging a colour, the foreground is coloured.  If it is not, the 
  3583. background is coloured. 
  3584.  
  3585. To set the presentation attributes for a region firstly select it from the 
  3586. pulldown and then set the attributes as shown below: 
  3587.  
  3588.  Font name / size Select a font name from the pulldown and use the spin button 
  3589.                 to select a font size.  (You can only set a font for regions 
  3590.                 that show text i.e. headings, column titles, data, totals and 
  3591.                 footings.) 
  3592.  Radio buttons  Select a radio button for the section of the region to be 
  3593.                 tailored, then select a colour from the colour matrix. The 
  3594.                 small colour sample square to the right of the button changes 
  3595.                 to reflect the selection. Different regions have different 
  3596.                 attributes that can be tailored. 
  3597.                      Region         Attributes 
  3598.                 Headings            Font, font size and text colour 
  3599.                 Column Titles       Font, font size and text colour 
  3600.                 Data                Font, font size and text colour 
  3601.                 Totals              Font, font size and text colour 
  3602.                 Footings            Font, font size and text colour 
  3603.                 Selected            Text and background colours 
  3604.                 Search Target       Text and background colours 
  3605.                 Background          Background and window frame colours 
  3606.                 Lines               Vertical and horizontal line colours 
  3607.                 Buttons             Row, column and cell selection button 
  3608.                                     colours 
  3609.                 Update              The colour of the  edit box and updated and 
  3610.                                     unapplied data changes 
  3611.  
  3612.  When the tailoring is complete for a region, you must press the Apply button 
  3613.  to register the settings for that region before the next region is selected. 
  3614.  
  3615.  
  3616. ΓòÉΓòÉΓòÉ 10.3.11. Data Update page ΓòÉΓòÉΓòÉ
  3617.  
  3618. You use the Data Update page to specify the mode you wish to use for the update 
  3619. of the data displayed in the Viewer. 
  3620.  
  3621. Viewer Settings - Data Update page 
  3622.  
  3623. You select on option from the following: 
  3624.  
  3625.  No Update            Select this if no updates are to be allowed to the Viewer 
  3626.                       data. 
  3627.  Update report Only   Select this to allow updates to be made to the data 
  3628.                       without issuing any update requests to the underlying 
  3629.                       table. 
  3630.  Update Table On Request Select this to allow updates made to the data to be 
  3631.                       issued to the underlying table. The update requests are 
  3632.                       pended until you specifically request their issue. 
  3633.  Update Table By Cell Select this to automatically issue a table update request 
  3634.                       when a single data cell is changed. 
  3635.  Update Table By Row  Select this to automatically issue a table update request 
  3636.                       when updates to a single row have been completed. 
  3637.  Update Table By Block Select this to automatically issue table update requests 
  3638.                       when a pre-determined number of rows have been changed. 
  3639.                       This value is set using the Block Size spin button. 
  3640.  
  3641.  Note:  In certain circumstances, some options will not be available. For 
  3642.  example, if the data displayed in the Viewer is the result of a query across 
  3643.  two or more tables then the four Table Update options will not be available. 
  3644.  
  3645.  The defaults for this page are retrieved from the Viewer section of the 
  3646.  XY-Query Settings facility. See Viewer Settings - Data Update page for more 
  3647.  information. 
  3648.  
  3649.  
  3650. ΓòÉΓòÉΓòÉ 10.4. Report styles ΓòÉΓòÉΓòÉ
  3651.  
  3652. After a query has run and returned data there are a large number of formatting 
  3653. options, available from the Viewer window settings notebook, you can use to 
  3654. make your report more informative and useful. 
  3655.  
  3656. Applying headings, footings, arithmetic functions and breaks amongst others 
  3657. enables you to change a data only report into one that is clearer and more 
  3658. useful. 
  3659.  
  3660. For example, it is possible to turn a report containing a large number of 
  3661. totals and sub-totals into a more concise report showing only the total data. 
  3662. XY-Query calls this report style Totals Only. 
  3663.  
  3664. There are some more advanced reporting styles and features available that give 
  3665. you more flexibility in your reporting. XY-Query calls these advanced report 
  3666. styles GROUP and ACROSS. 
  3667.  
  3668.  
  3669. ΓòÉΓòÉΓòÉ 10.4.1. Creating a Totals Only report ΓòÉΓòÉΓòÉ
  3670.  
  3671. If you have a report on which you have specified breaks and arithmetic usages 
  3672. you get a report with a mixture of data and total rows. The following fragment 
  3673. is an example of the report layout you may see. 
  3674.  
  3675. DEPT     JOB   YEARS   SALARY
  3676. --------------------------------
  3677. 10       Mgr     7     22,959.20
  3678.                  10    20,010.00
  3679.                  5     19,260.25
  3680.                  12    21,234.00
  3681.                  9     83,463.45
  3682.                  9     83,463.45
  3683. 15       Clerk   5     12,508.20
  3684.                  4     12,258.50
  3685.                  5     24,766.70
  3686.          Mgr     10    20,659.80
  3687.                  10    20,659.80
  3688.          Sales   7     16,502.83
  3689.                  7     16,502.83
  3690.                  7     61,929.33
  3691.  
  3692. When the data is viewed in Report view/read only mode the repeated break data 
  3693. is not displayed. This means that in large reports it may not be very easy to 
  3694. see which break values relate to which sub-total. 
  3695.  
  3696. By selecting the Break data on totals option on the Break page of the Viewer 
  3697. settings notebook, you can drop the break data relating to the total onto the 
  3698. total line. 
  3699.  
  3700. Doing this would change this report fragment as follows: 
  3701.  
  3702. DEPT     JOB   YEARS   SALARY
  3703. --------------------------------
  3704. 10       Mgr     7     22,959.20
  3705.                  10    20,010.00
  3706.                  5     19,260.25
  3707.                  12    21,234.00
  3708. 10       Mgr     9     83,463.45
  3709. 10               9     83,463.45
  3710. 15       Clerk   5     12,508.20
  3711.                  4     12,258.50
  3712. 15       Clerk   5     24,766.70
  3713.          Mgr     10    20,659.80
  3714. 15       Mgr     10    20,659.80
  3715.          Sales   7     16,502.83
  3716. 15       Sales   7     16,502.83
  3717. 15               7     61,929.33
  3718.  
  3719. The next stage on from this would be to only display the total lines. You can 
  3720. specify this by selecting the Totals only option on the Break page of the 
  3721. Viewer settings notebook. 
  3722.  
  3723. If both options are set you can generate a summary totals report which displays 
  3724. only the calculations and totals you are interested in. The following figure 
  3725. gives an example XY-Query report in which the first two columns have been given 
  3726. break levels and the latter two arithmetic usages. The options to drop the 
  3727. break data onto the total lines and to show only the total lines have both been 
  3728. selected. 
  3729.  
  3730.  
  3731. Viewer - Totals Only Report 
  3732.  
  3733. When the Viewer, whilst displaying a Totals only report, is switched into Form 
  3734. view a row by row analysis of the total data can be performed. Each totals row 
  3735. will be presented individually in the Form view. 
  3736.  
  3737.  
  3738. ΓòÉΓòÉΓòÉ 10.4.2. Creating a GROUP report ΓòÉΓòÉΓòÉ
  3739.  
  3740. Group reports have been enabled by the provision of the usage GROUP in the 
  3741. usage field of the Columns page of the Viewer settings notebook. 
  3742.  
  3743. In essence a Group report is a summary report. It summarises values, in one or 
  3744. more columns which have arithmetic usages defined, against distinct values or 
  3745. combinations in one or more columns to which GROUP usages have been defined. 
  3746.  
  3747. The description of a Group report is best served by means of an example. 
  3748. Suppose the following data was returned to XY-Query from a database. 
  3749.  
  3750. DEPT     YEARS   SALARY
  3751. --------------------------
  3752. 10       7       22,959.20
  3753. 10       10      20,010.00
  3754. 10       5       19,260.25
  3755. 10       12      21,234.00
  3756. 15       10      20,659.80
  3757. 15       7       16,502.83
  3758. 15       5       12,508.20
  3759. 15       4       12,258.50
  3760. 20       7       18,357.50
  3761. 20       8       18,171.25
  3762. 20       -       13,504.60
  3763. 20       8       14,252.75
  3764.  
  3765. If usages are applied to the data columns as follows the data report can be 
  3766. transformed into a Group summary report. 
  3767.  
  3768.  DEPT      GROUP 
  3769.  YEARS     AVG 
  3770.  SALARY    SUM 
  3771.  
  3772.  
  3773.  The following report fragment shows how the data has been summarised according 
  3774.  to the usages set. 
  3775.  
  3776.            AVG     SUM
  3777.   DEPT     YEARS   SALARY
  3778.   --------------------------
  3779.   10       9       83,463.45
  3780.   15       7       61,929.33
  3781.   20       8       64,286.10
  3782.  
  3783.  When XY-Query produces the summary data for the Group report it processes the 
  3784.  rows of data returned from the database in the order they are returned. When 
  3785.  the value in the selected Group column changes it is considered to be the end 
  3786.  of the current group and summary data is produced at that point. This means 
  3787.  that in order to guarantee the most concise and useful Group report, the query 
  3788.  executed must request the data to be returned in the order of the GROUPed 
  3789.  columns. 
  3790.  
  3791.  As soon as one column is given the GROUP usage XY-Query will convert the 
  3792.  current report into a Group report. All columns that have being given an 
  3793.  aggregation usage (SUM/AVG/MIN/MAX/COUNT) will immediately be summarised 
  3794.  according to their usage. Any columns that do not have an aggregation usage 
  3795.  will be left empty. 
  3796.  
  3797.  Group reports in XY-Query can still benefit from the large number of other 
  3798.  formatting options available. For example the following figure shows a report 
  3799.  which has two GROUP columns, headings, footings and a break level specified. 
  3800.  
  3801.  Viewer - Group report 
  3802.  
  3803.  When the Viewer, whilst displaying a Group report, is switched into Form view 
  3804.  a row by row analysis of the summarised data can be performed. Each summarised 
  3805.  row will be presented individually in the Form view. Note that only the 
  3806.  summary data rows will be displayed in the Form view. Any total rows caused by 
  3807.  break levels or the grand total row will not be displayed. 
  3808.  
  3809.  
  3810. ΓòÉΓòÉΓòÉ 10.4.3. Creating an ACROSS report ΓòÉΓòÉΓòÉ
  3811.  
  3812. When you have produced your summary Group report it is then possible to take it 
  3813. a step further and convert it into an Across report. This type of report hinges 
  3814. on the selection of one column in the report to have a usage code of ACROSS. 
  3815. This is set from the Columns page of the Viewer settings notebook. Note that 
  3816. only one column can have this usage code. Setting it to a second will 
  3817. automatically remove it from the original. 
  3818.  
  3819. In an Across report additional columns of data are created in the report that 
  3820. summarise the column chosen as the ACROSS column. For each distinct value in 
  3821. this column a group of columns will be produced that display the summarised 
  3822. values for the columns with aggregation usages applied to them. 
  3823.  
  3824. The description of an Across report is best served by means of an example. 
  3825. Suppose the following data was returned to XY-Query from a database. 
  3826.  
  3827. DEPT     JOB     YEARS   SALARY
  3828. ----------------------------------
  3829. 10       Mgr     7       22,959.20
  3830. 10       Mgr     10      20,010.00
  3831. 10       Mgr     5       19,260.25
  3832. 10       Mgr     12      21,234.00
  3833. 15       Clerk   5       12,508.20
  3834. 15       Clerk   4       12,258.50
  3835. 15       Mgr     10      20,659.80
  3836. 15       Sales   7       16,502.83
  3837. 20       Clerk   -       13,504.60
  3838. 20       Clerk   8       14,252.75
  3839. 20       Mgr     7       18,357.50
  3840. 20       Sales   8       18,171.25
  3841. 38       Clerk   -       12,954.75
  3842. 38       Clerk   3       12,009.75
  3843. 38       Mgr     5       17,506.75
  3844. 38       Sales   6       18,006.00
  3845. 38       Sales   -       16,808.30
  3846.  
  3847. Firstly, apply the following usages to the data columns to produce a Group 
  3848. report. 
  3849.  
  3850.  DEPT      GROUP 
  3851.  JOB       GROUP 
  3852.  YEARS     AVG 
  3853.  SALARY    SUM 
  3854.  
  3855.  The following report fragment shows how the data will be summarised according 
  3856.  to the usages set. 
  3857.  
  3858.                    AVG     SUM
  3859.   DEPT     JOB     YEARS   SALARY
  3860.   ----------------------------------
  3861.   10       Mgr     9       83,463.45
  3862.   15       Clerk   5       24,766.70
  3863.   15       Mgr     10      20,659.80
  3864.   15       Sales   7       16,502.83
  3865.   20       Clerk   8       27,757.35
  3866.   20       Mgr     7       18,357.50
  3867.   20       Sales   8       18,171.25
  3868.   38       Clerk   3       24,964.50
  3869.   38       Mgr     5       17,506.75
  3870.   38       Sales   6       34,814.30
  3871.  
  3872.  Now change the usage of the JOB column to be ACROSS. This has a marked effect 
  3873.  on the data that is displayed. 
  3874.  
  3875.            <--------------------------------- JOB ------------------------------->
  3876.            <----- Mgr ----->  <---- Clerk --->  <---- Sales --->  <---- TOTAL --->
  3877.            AVG     SUM        AVG    SUM        AVG    SUM        AVG    SUM
  3878.   DEPT     YEARS   SALARY     YEARS  SALARY     YEARS  SALARY     YEARS  SALARY
  3879.   10       9       83,463.45                                      9      83,463.45
  3880.   15       10      20,659.80  5      24,766.70  7      16,502.83  7      61,929.33
  3881.   20       7       18,357.50  8      27,757.35  8      18,171.25  8      64,286.10
  3882.   38       5       17,506.75  3      24,964.50  6      34,814.30  5      77,285.55
  3883.  
  3884.  You will notice that the JOB column has been removed from the report and in 
  3885.  its place a number of extra column groupings have been created. The distinct 
  3886.  values in the JOB column (Mgr/Clerk/Sales) are each given their own column 
  3887.  grouping which present the calculated totals for the columns with aggregation 
  3888.  usages. 
  3889.  
  3890.  The column titles region will expand to show on which column the report is 
  3891.  based, in this instance JOB, and the distinct values found in the column which 
  3892.  now have individual summary column groupings. 
  3893.  
  3894.  If you want to re-order the columns in the Viewer by using the Subset page of 
  3895.  the settings, all of the across groupings will be treated as one column and 
  3896.  positioned en-masse wherever the ACROSS column is placed. The total columns in 
  3897.  the report are the real aggregated columns and can positioned as you wish, 
  3898.  together as shown above or separated as required. Only GROUP columns can be 
  3899.  fixed in an Across report. 
  3900.  
  3901.  Across reports in XY-Query can still benefit from the large number of other 
  3902.  formatting options available. For example the following figure shows an Across 
  3903.  report with headings, footings and the GROUP column fixed. 
  3904.  
  3905.  Viewer - Across report 
  3906.  
  3907.  When the Viewer, whilst displaying an Across report, is switched into Form 
  3908.  view a row by row analysis of the summarised data can be performed. Each 
  3909.  summarised row will be presented individually in the Form view. Note that only 
  3910.  the summary data rows will be displayed in the Form view. Any total rows 
  3911.  caused by break levels or the grand total row will not be displayed. 
  3912.  
  3913.  
  3914. ΓòÉΓòÉΓòÉ 11. Working with the Chart window ΓòÉΓòÉΓòÉ
  3915.  
  3916.  
  3917. ΓòÉΓòÉΓòÉ 11.1. Introduction ΓòÉΓòÉΓòÉ
  3918.  
  3919. This chapter explains the functions available from the Chart window and the 
  3920. Chart window settings notebook. 
  3921.  
  3922. For instructions on using the Viewer to display your output, see chapter 
  3923. Working with the Viewer window. 
  3924.  
  3925.  
  3926. ΓòÉΓòÉΓòÉ 11.2. Using the Chart window ΓòÉΓòÉΓòÉ
  3927.  
  3928. From the Chart window, the following facilities are available: 
  3929.  
  3930.      Save the current object (Saving from the Chart window) 
  3931.      Copy to an XY-Query object (Copying to an XY-Query object) 
  3932.      Export the Chart data (Exporting Chart data to a file) 
  3933.      Place data in the OS/2 clipboard (Copying a Chart to the clipboard) 
  3934.      Print the chart (Printing a chart) 
  3935.      Refresh the chart displayed by re-running the query (Refreshing the 
  3936.       Chart) 
  3937.      Utilities (Utilities from the Chart window) 
  3938.      Tailor the appearance of the Chart using the Chart settings (Chart window 
  3939.       settings) 
  3940.  
  3941.  
  3942. ΓòÉΓòÉΓòÉ 11.2.1. Saving from the Chart window ΓòÉΓòÉΓòÉ
  3943.  
  3944. To perform a save, open the File menu and select Save. This saves all 
  3945. information about the three windows associated with the current object, namely 
  3946. the SQL , Viewer and Chart windows. It does not affect the type of object. You 
  3947. can validly request a save from the Chart window even if the current object is 
  3948. an SQL or Viewer object. 
  3949.  
  3950.  
  3951. ΓòÉΓòÉΓòÉ 11.2.2. Copying to an XY-Query object ΓòÉΓòÉΓòÉ
  3952.  
  3953. To create a copy of the current XY-Query object, open the File menu of the 
  3954. Chart window and select Copy to... to obtain a dialog box. This has the same 
  3955. appearance as the one used for copying or exporting from the SQL window 
  3956. (Copy-To dialog box). 
  3957.  
  3958. The formats available for copying are: 
  3959.  
  3960.      XYChart 
  3961.      XYViewer 
  3962.      XYQuery 
  3963.  
  3964.  You select a format, then specify a file name and directory path.  A new 
  3965.  XY-Query object of the type specified is created, identical, in all but name, 
  3966.  to the current state of the active object. The format you select determines 
  3967.  the primary view of the newly created object. 
  3968.  
  3969.  
  3970. ΓòÉΓòÉΓòÉ 11.2.3. Exporting Chart data to a file ΓòÉΓòÉΓòÉ
  3971.  
  3972. To export the Chart, open the Chart menu of the Chart window and select 
  3973. Export.... The dialog box displayed the same appearance as the one used for 
  3974. copying or exporting Copy-to activities (see Copy-To dialog box). 
  3975.  
  3976. The file formats available for exporting are: 
  3977.  
  3978.            Bitmap     (.BMP)
  3979.  
  3980.            Metafile   (.MET)
  3981.  
  3982.  Select a format, then specify a file name and directory path for the exported 
  3983.  chart. 
  3984.  
  3985.  
  3986. ΓòÉΓòÉΓòÉ 11.2.4. Copying a Chart to the clipboard ΓòÉΓòÉΓòÉ
  3987.  
  3988. You can copy the whole chart to the OS/2 clipboard by selecting the Copy option 
  3989. of the Edit menu. The chart is placed in the clipboard in Bitmap and Metafile 
  3990. formats. 
  3991.  
  3992. You can paste the chart only into applications that can accept the Bitmap and 
  3993. Metafile formats. 
  3994.  
  3995.  
  3996. ΓòÉΓòÉΓòÉ 11.2.5. Printing a chart ΓòÉΓòÉΓòÉ
  3997.  
  3998. To print the Chart: 
  3999.  
  4000.    1. Open the File menu and select Print, or press the printer icon on the 
  4001.       toolbar to display a dialog box listing all available printers. 
  4002.    2. Select a printer. 
  4003.    3. Press the Job button to display and change the job properties for this 
  4004.       printer. 
  4005.    4. Press the Print button to confirm the printing request. 
  4006.  
  4007.  The image of the Chart display area is then printed on the specified printer. 
  4008.  
  4009.  XY-Query uses the OS/2 formatted print drivers installed on your system to 
  4010.  produce hardcopy output. 
  4011.  
  4012.  If you have a problem printing on a LAN connected printer where the printer 
  4013.  starts up when the job is submitted but no text appears, try the following: 
  4014.  
  4015.    1. Open the Settings for your printer object. 
  4016.    2. Turn to the Queue options page. 
  4017.    3. Select the Printer-specific format option. 
  4018.  
  4019.  
  4020. ΓòÉΓòÉΓòÉ 11.2.6. Refreshing the Chart ΓòÉΓòÉΓòÉ
  4021.  
  4022. To refresh the Chart, the query has to be re-run. You do this either from the 
  4023. SQL window itself or by selecting the Refresh now option from the Chart menu. 
  4024.  
  4025. You can stop a running query by selecting the Stop option from the Chart menu. 
  4026. The data retrieved so far is plotted in the Chart window. 
  4027.  
  4028. You can request that the Chart is continually refreshed and re-plotted thus 
  4029. reflecting dynamically any changes to the database. The query is re-run after a 
  4030. pre-defined delay. 
  4031.  
  4032. To specify that the data is automatically refreshed, open the Chart menu and 
  4033. select AutoRefresh. To terminate the auto-refreshing repeat this action. 
  4034.  
  4035. You can define the auto-refresh interval in the Timings page in the XY-Query 
  4036. Settings facility. See Using the XY-Query settings facility. 
  4037.  
  4038. Note:  A Chart is subject to auto-refresh even if the request was issued from 
  4039. the Viewer. When the query is re-run XY-Query refreshes all data display 
  4040. windows that are visible. 
  4041.  
  4042.  
  4043. ΓòÉΓòÉΓòÉ 11.2.7. Utilities from the Chart window ΓòÉΓòÉΓòÉ
  4044.  
  4045. The standard set of XY-Query utility functions are available from the Chart 
  4046. window. 
  4047.  
  4048. Some utilities are limited only to DB2/2 but others are open to all DB2 
  4049. databases and XDB. 
  4050.  
  4051.      Create a DB2/2 database (Create Database) 
  4052.      Erase a DB2/2 database (Erase Database) 
  4053.      Create, or append to, a DB2 or XDB table (Creating, or appending to a 
  4054.       table using Viewer data) 
  4055.      Define a new DB2 or XDB table (Defining a new table) 
  4056.      Erase a DB2 or XDB table (Erasing a table) 
  4057.      Create a DB2/2 table by importing a file (Importing a table) 
  4058.      Register and de-register logons and passwords (Managing sessions) 
  4059.  
  4060.  
  4061. ΓòÉΓòÉΓòÉ 11.3. Chart window settings ΓòÉΓòÉΓòÉ
  4062.  
  4063. Each Chart window has a Settings Notebook from where you can set the attributes 
  4064. and presentation styles for the window. You can use the Chart window settings 
  4065. notebook to override the default settings for the appearance of the Chart 
  4066. window and apply your own individual tailoring. 
  4067.  
  4068. There are number of ways to open the Chart settings notebook. It can be 
  4069. requested by selecting the Open Settings option of the View menu, or by 
  4070. pressing the Settings button on the toolbar. Both of these methods display the 
  4071. notebook in its default state with the first page at the top. 
  4072.  
  4073. You can also open the notebook at a specific page with certain fields 
  4074. pre-selected. This can be achieved by pressing the right hand mouse button 
  4075. either on its own or in conjunction with the CTRL key whilst the mouse pointer 
  4076. is over certain regions in the Chart window. 
  4077.  
  4078. The Chart window settings notebook consists of eight pages as follows: 
  4079.  
  4080.      Types page 
  4081.      Titles page 
  4082.      Axes page 
  4083.      Labels page 
  4084.      Legend page 
  4085.      Elements page 
  4086.      Background page 
  4087.      Subset page 
  4088.  
  4089.  Note:  In general all pages in a Settings notebook have Apply, Undo and 
  4090.  Default buttons as standard. The Apply button takes the current settings for 
  4091.  the page and applies them to the object. The Undo button sets the page 
  4092.  settings back to the state they were in at the time of the last apply. The 
  4093.  Default button causes the default settings to be reflected on the page. The 
  4094.  defaults can be application supplied or can be supplied by the XY-Query 
  4095.  Settings facility. These defaults will only be reflected in the object itself 
  4096.  if they are explicitly applied. 
  4097.  
  4098.  
  4099. ΓòÉΓòÉΓòÉ 11.3.1. Types page ΓòÉΓòÉΓòÉ
  4100.  
  4101. You use the Types page to set the presentation attributes for the types of 
  4102. chart which can be displayed. Although the data can only be represented by one 
  4103. chart at a time you can set up style attributes for all available chart types. 
  4104. The examples show the settings for a bar chart and a pie chart. 
  4105.  
  4106. Chart Settings - Types page (for bar charts) 
  4107.  
  4108. Chart Settings - Types page (for pie charts) 
  4109.  
  4110. In its default state this page reflects the settings defined for the chart 
  4111. types in the Chart section of the XY-Query settings facility.  See Chart 
  4112. Settings - Types page for more information. 
  4113.  
  4114. Any changes made in this page are limited to the current object and do not 
  4115. affect the global settings. 
  4116.  
  4117. Complete the Types page as follows: 
  4118.  
  4119.  Chart   Use the pulldown to choose the type of chart for which to set the 
  4120.          style attributes and to display. 
  4121.  Styles  Each individual chart type has its own unique set of style attributes 
  4122.          that can be tailored. The displayed attributes change dynamically 
  4123.          whenever a new type is selected from the chart pulldown. You should 
  4124.          set the options as desired for each chart type. 
  4125.  
  4126.  You must press the Apply button on the page to retain the tailored settings 
  4127.  for each chart type. This re-plots the chart taking account of the latest 
  4128.  presentation settings. 
  4129.  
  4130.  Note:  You can also switch the chart displayed between different types by 
  4131.  using the relevant buttons on the toolbar. (The presentation of the displayed 
  4132.  chart is determined by the style attributes for the chart type as detailed on 
  4133.  this page.)  If the notebook is displayed whenever the toolbar method is used 
  4134.  then this page is brought to the front with the newly selected chart type and 
  4135.  its style settings pre-filled in the page. 
  4136.  
  4137.  
  4138. ΓòÉΓòÉΓòÉ 11.3.2. Titles page ΓòÉΓòÉΓòÉ
  4139.  
  4140. You use the Titles page to set the text to be displayed for the various titles 
  4141. that appear on a chart.  You can also set the colour for the title and the 
  4142. attributes of the box in which the title appears. 
  4143.  
  4144. Chart Settings - Titles page 
  4145.  
  4146. In its default state this page reflects the settings defined for the chart 
  4147. titles in the Chart section of the XY-Query settings facility. See Chart 
  4148. Settings - Titles page for more information. 
  4149.  
  4150. Any changes made in this page are limited to the current object and do not 
  4151. affect the global settings. 
  4152.  
  4153. Complete the Titles page as follows: 
  4154.  
  4155.  Title      Use the pulldown to choose the titles for which to set the text and 
  4156.             presentation attributes. There are five titles for which attributes 
  4157.             can be set, namely: 
  4158.                 The main title of the chart 
  4159.                 Title along X-Axis 
  4160.                 Title along Y-Axis 
  4161.                 Title along Y2-Axis 
  4162.                 Pie chart title (colour attributes only) 
  4163.  Data       Use this field to enter the actual text to appear in the title area 
  4164.             on the chart.  This field is not available for the Pie Title option 
  4165.             as the titles that appear over this type of chart is determined by 
  4166.             the column name on which it is based. For the Main Title only it is 
  4167.             possible to split the title over multiple lines by adding the 
  4168.             characters /n at the point of a line break. For example, entering 
  4169.             Salary Report/nBy Department would put the title on two lines. 
  4170.  Font Name / Font Size Use these fields to specify the font used to display the 
  4171.             title text on the chart. 
  4172.  Foreground Use this field to set the foreground colour for the title text. 
  4173.             Select the foreground radio button and then select the required 
  4174.             colour from the colour matrix. The small colour sample square to 
  4175.             the left of the button changes to show your selection. 
  4176.  Background Use this field to set the background colour for the box containing 
  4177.             the title text. Select the background radio button and then select 
  4178.             the required colour from the colour matrix.  The small colour 
  4179.             sample square to the left of the button changes to reflect the 
  4180.             selection. 
  4181.  Outline    Use this field to set the outline colour for the box containing the 
  4182.             title text. Select the Outline radio button and then select the 
  4183.             required colour from the colour matrix. The small colour sample 
  4184.             square to the left of the button changes to reflect the selection. 
  4185.  Shadow     Use this field to determine whether or not the box containing the 
  4186.             title text is displayed with a shadow. 
  4187.  
  4188.  You must select the Apply button on the page to retain the tailored settings 
  4189.  for each chart type.  This re-plots the chart to take account of the latest 
  4190.  set of presentation attributes. 
  4191.  
  4192.  Note:  Only the titles relevant to the currently displayed chart type are 
  4193.  available. For example, you cannot set Pie Title attributes when the currently 
  4194.  displayed chart is a bar chart. 
  4195.  
  4196.  
  4197. ΓòÉΓòÉΓòÉ 11.3.3. Axes page ΓòÉΓòÉΓòÉ
  4198.  
  4199. Use the Axes page to set the display attributes for the various axes that 
  4200. appear on a chart. 
  4201.  
  4202. Chart Settings - Axes page 
  4203.  
  4204. In its default state this page reflects the settings defined for the chart axes 
  4205. in the Chart section of the XY-Query settings facility, See Chart Settings - 
  4206. Axes page for more information. Any changes made in this page are limited to 
  4207. the current object and do not affect the global settings. 
  4208.  
  4209. Complete the Axes page as follows: 
  4210.  
  4211.  Axis       Use the pulldown to choose the axis for which to set the 
  4212.             presentation attributes.  There are three axes for which attributes 
  4213.             can be set, namely: 
  4214.                 X-Axis 
  4215.                 Y-Axis 
  4216.                 Y2-Axis 
  4217.  Font Name / Font Size Use these fields to specify the font in which the axis 
  4218.             values should be displayed on the chart. 
  4219.  Foreground Use this field to set the foreground colour for the axis value 
  4220.             text. Select the foreground radio button and then select the 
  4221.             required colour from the colour matrix. The small colour sample 
  4222.             square to the left of the button changes to reflect the selection. 
  4223.  Background Use this field to set the background colour for the box containing 
  4224.             the axis value text. Select the background radio button and then 
  4225.             select the required colour from the colour matrix. The small colour 
  4226.             sample square to the left of the button changes to reflect the 
  4227.             selection. 
  4228.  Gridlines  Select this option if guide lines are required from the relevant 
  4229.             axis through the chart display. 
  4230.  Data Angle This option is available only for the X-axis and can be used to set 
  4231.             the orientation of the text written along the X-axis. 
  4232.  Tickmarks  This option is available only for the Y axes and can be used to set 
  4233.             the position, if required, of tickmarks to be shown on a Y axis. 
  4234.  
  4235.  You must select the Apply button on the page to retain the tailored settings 
  4236.  for each axis.  This re-plots the chart to take account of the latest set of 
  4237.  presentation attributes. 
  4238.  
  4239.  Note:  Only the axes relevant to the currently displayed chart type are 
  4240.  available. For example, this page is totally disabled if a Pie Chart is 
  4241.  currently being displayed. 
  4242.  
  4243.  
  4244. ΓòÉΓòÉΓòÉ 11.3.4. Labels page ΓòÉΓòÉΓòÉ
  4245.  
  4246. You Use the Labels page to set the presentation attributes for any data labels 
  4247. that are to be displayed on the chart. 
  4248.  
  4249. Chart Settings - Labels page 
  4250.  
  4251. In its default state this page reflects the settings defined for the data 
  4252. labels in the Chart section of the XY-Query settings facility. See Chart 
  4253. Settings - Labels page for more information. Any changes made in this page are 
  4254. limited to the current object and do not affect the global settings. 
  4255.  
  4256. Complete the Labels page as follows: 
  4257.  
  4258.  Font Name / Font Size Use these fields to decide the font and font size to be 
  4259.                 used for the label's text. 
  4260.  Foreground     Use this field to set the foreground colour for the label value 
  4261.                 text. Select the foreground radio button and then select the 
  4262.                 required colour from the colour matrix. The small colour sample 
  4263.                 square to the left of the button changes to reflect the 
  4264.                 selection. 
  4265.  Background     Use this field to set the background colour for the box 
  4266.                 containing the label value text. Select the background radio 
  4267.                 button and then select the required colour from the colour 
  4268.                 matrix. The small colour sample square to the left of the 
  4269.                 button changes to reflect the selection. 
  4270.  Percent Format This field is only relevant for Pie Charts and when set shows 
  4271.                 the label values as percentages of the whole as opposed to 
  4272.                 simple numeric values. 
  4273.  Position       Select a radio button to choose where on the chart to write the 
  4274.                 data labels. If no labels are required then select None. 
  4275.  
  4276.  
  4277. ΓòÉΓòÉΓòÉ 11.3.5. Legend page ΓòÉΓòÉΓòÉ
  4278.  
  4279. Chart Settings - Legend page 
  4280.  
  4281. Use the Legend page to set the presentation attributes for the legend that is 
  4282. to be displayed on the chart. The legend is the descriptor that explains the 
  4283. colours used for each series plotted in the chart. The colours shown in the 
  4284. legend can be tailored for each series by using the Elements page as described 
  4285. in Elements page. 
  4286.  
  4287. In its default state this page reflects the settings defined for a legend in 
  4288. the Chart section of the XY-Query settings facility. See Chart Settings - 
  4289. Legend page for more information. 
  4290.  
  4291. Any changes made in this page are limited to the current object and do not 
  4292. affect the global settings. 
  4293.  
  4294. Complete the Legend page as follows: 
  4295.  
  4296.  Font Name / Font Size Use these fields to decide the font and font size used 
  4297.             to write any legend text. 
  4298.  Foreground Use this field to set the foreground colour for the legend text. 
  4299.             Select the foreground radio button and then select the required 
  4300.             colour from the colour matrix. The small colour sample square to 
  4301.             the left of the button changes to reflect the selection. 
  4302.  Background Use this field to set the background colour for the box containing 
  4303.             the legend. Select the background radio button and then select the 
  4304.             required colour from the colour matrix. The small colour sample 
  4305.             square to the left of the button changes to reflect the selection. 
  4306.  Outline    To set the outline colour for the box containing the legend. Select 
  4307.             the Outline radio button and then select the required colour from 
  4308.             the colour matrix. The small colour sample square to the left of 
  4309.             the button changes to reflect the selection. 
  4310.  Shadow     Use this field to determine whether or not the box containing the 
  4311.             legend is displayed with a shadow. 
  4312.  Position   Select a radio button to choose where on the chart the legend is to 
  4313.             appear.  If no legend is required then select None. 
  4314.  
  4315.  
  4316. ΓòÉΓòÉΓòÉ 11.3.6. Elements page ΓòÉΓòÉΓòÉ
  4317.  
  4318. You use the Elements page to change the name and colour by which a series is 
  4319. represented on a chart. The changes to the name of the series and its colour 
  4320. are visible on the chart itself and in the legend if it is displayed. 
  4321.  
  4322. Chart Settings - Elements page 
  4323.  
  4324. Complete the Elements page as follows: 
  4325.  
  4326.  Name       Select the series name as shown on the chart from this pulldown. 
  4327.             The temporary name and colour representation of this series can 
  4328.             then be set. The real name (as returned by the query) is shown in 
  4329.             static text below the Data field. 
  4330.  Data       Use this field to change the name of the series element selected in 
  4331.             the Name field. 
  4332.  Foreground Use the Foreground button to determine the foreground colour of the 
  4333.             items in the pattern matrix. 
  4334.  Background Use the Background button to determine the background colour of the 
  4335.             items in the pattern matrix. 
  4336.  Pattern    Select a pattern from the pattern matrix to be used to represent 
  4337.             the series on the chart. 
  4338.  
  4339.  You must select the Apply button on the page to retain the tailored settings 
  4340.  for each series. 
  4341.  
  4342.  
  4343. ΓòÉΓòÉΓòÉ 11.3.7. Background page ΓòÉΓòÉΓòÉ
  4344.  
  4345. Chart Settings - Background page 
  4346.  
  4347. Use the Background page to set the overall background colour of the chart 
  4348. window. 
  4349.  
  4350. Complete the Background page as follows: 
  4351.  
  4352.  Colour         Select a colour from the colour matrix. The small colour sample 
  4353.                 square changes to reflect the selection. Select the Apply 
  4354.                 button to change the chart background to the selected colour. 
  4355.  
  4356.  The default for this page is retrieved from the Chart section of the XY-Query 
  4357.  Settings facility. See Chart Settings - Background page for more information. 
  4358.  
  4359.  
  4360. ΓòÉΓòÉΓòÉ 11.3.8. Subset page ΓòÉΓòÉΓòÉ
  4361.  
  4362. You use the Subset page to specify series data for the X and Y axes. The X axis 
  4363. can have only one series specified but multiple numeric series can be plotted 
  4364. against the Y axis. 
  4365.  
  4366. You also use this page to determine which subset of rows of data returned from 
  4367. the query are to be plotted. 
  4368.  
  4369. Chart Settings - Subset page 
  4370.  
  4371. Complete the Subset page as follows: 
  4372.  
  4373.  X-Axis Data    Select a series from the pulldown to be show against the X 
  4374.                 axis. 
  4375.  Starting Row / Ending Row Use these fields to specify which subset of rows 
  4376.                 returned by the query are to be plotted on the chart. By 
  4377.                 default the first 10 rows are displayed. 
  4378.  Y-Axis Data    Select the series from the pulldown to be plotted against the Y 
  4379.                 axis. 
  4380.  Select All / Deselect All Use these buttons to select or de-select all of the 
  4381.                 series entries in the Y-axis data list. 
  4382.  
  4383.  
  4384. ΓòÉΓòÉΓòÉ 12. XY-Query utilities ΓòÉΓòÉΓòÉ
  4385.  
  4386.  
  4387. ΓòÉΓòÉΓòÉ 12.1. Utility functions ΓòÉΓòÉΓòÉ
  4388.  
  4389. This chapter describes the standard set of utility functions that are available 
  4390. from the SQL, Viewer and Chart windows. Each window has a menu item named 
  4391. Utilities under which the following general facilities are found: 
  4392.  
  4393.      Create a DB2/2 database (Create Database) 
  4394.      Erase a DB2/2 database (Erase Database) 
  4395.      Create, or append to, a DB2 or XDB table (Creating, or appending to a 
  4396.       table using Viewer data) 
  4397.      Define a new DB2 or XDB table (Defining a new table) 
  4398.      Alter definition of a DB2 or XDB table (Altering the definition of a 
  4399.       table) 
  4400.      Erase a DB2 or XDB table (Erasing a table) 
  4401.      Create a DB2/2 table by importing a file (Importing a table) 
  4402.      Register and de-register logons and passwords (Managing sessions) 
  4403.  
  4404.  As can be seen from this list, some utilities are limited to DB2/2 whereas 
  4405.  others are open to any DB2 or XDB database. 
  4406.  
  4407.  
  4408. ΓòÉΓòÉΓòÉ 12.2. Create Database ΓòÉΓòÉΓòÉ
  4409.  
  4410. To create a DB2/2 database, open the Utilities menu and select Database 
  4411. followed by Create.... 
  4412.  
  4413. This displays a dialog box which should be used to specify the name and 
  4414. physical location of the new database. The fields should be completed as 
  4415. follows: 
  4416.  
  4417.  Name      Enter the name of the new database (up to eight alpha-numeric 
  4418.            characters) 
  4419.  Comment   Enter an optional comment for the database 
  4420.  Drive     Enter the letter of the hard disk drive where the database will 
  4421.            reside. 
  4422.  Name/Comments List A reference list showing all currently catalogued DB2/2 
  4423.            databases 
  4424.  
  4425.  Press OK to create the database. 
  4426.  
  4427.  
  4428. ΓòÉΓòÉΓòÉ 12.3. Erase Database ΓòÉΓòÉΓòÉ
  4429.  
  4430. To erase a DB2/2 database, open the Utilities menu and select Database followed 
  4431. by Erase.... 
  4432.  
  4433. This displays a dialog box. used to identify the database to be removed. 
  4434.  
  4435. The fields should be completed as follows: 
  4436.  
  4437.  Name      Enter the name of the database to be deleted. 
  4438.  Comment   Read only reference field. This is filled when an entry is selected 
  4439.            from the Name/Comment list. 
  4440.  Drive     Read only reference field. This is filled when an entry is selected 
  4441.            from the Name/Comment list. This shows on which drive the database 
  4442.            to be erased is situated. 
  4443.  Name/Comments List Select the database to delete from this list. When one is 
  4444.            selected the Name, Comment and Drive fields are updated to reflect 
  4445.            the selection. 
  4446.  
  4447.  Press OK to remove the database. 
  4448.  
  4449.  
  4450. ΓòÉΓòÉΓòÉ 12.4. Creating, or appending to a table using Viewer data ΓòÉΓòÉΓòÉ
  4451.  
  4452. To save the data in the Viewer as a table locally or remotely , open the 
  4453. Utilities menu and select Table followed by Create and then finally From Viewer 
  4454. Data.... 
  4455.  
  4456. Create Table From Viewer Data 
  4457.  
  4458. A dialog box is displayed. which you use to specify the name of the table to be 
  4459. created or appended to, the location and potentially the database and 
  4460. tablespace combination, in which the table is to reside. The fields should be 
  4461. completed as follows: 
  4462.  
  4463.  Location       Select the location at which the table is to be created 
  4464.  Name           Enter the name of the table to be created 
  4465.  Comment        Enter a comment to be associated with the table 
  4466.  Convert Table Name to Upper Case Select this option to ensure the table name 
  4467.                 is converted to upper case. 
  4468.  Owner List     Press the Refresh button to populate this list with all table 
  4469.                 owners at the selected location. 
  4470.  Name/Comments List Populate this list by selecting an owner from the owner 
  4471.                 list. Selecting a table from this list will cause the Name and 
  4472.                 Comment fields to be changed to the selected table. 
  4473.  Database       Use this field to specify in which database at the named 
  4474.                 location the table will be created. 
  4475.  Tablespace     Use this field to specify in which tablespace in the named 
  4476.                 database the table will be created. 
  4477.  
  4478.  Press Create to create a new table, or press Append to add the data to an 
  4479.  existing table. 
  4480.  
  4481.  Note: 
  4482.  
  4483.    1. The database and tablespace fields are required only for locations such 
  4484.       as DB2/MVS and XDB that use these concepts. If they are not specified 
  4485.       then the table will be created in the default database and tablespace at 
  4486.       the named location. 
  4487.    2. The table will reflect the column titles and sequence as displayed in the 
  4488.       Viewer. These may have been tailored from the Viewer settings notebook 
  4489.       (see Viewer window settings). It will not reflect headings and footings, 
  4490.       column widths or usages. 
  4491.  
  4492.  
  4493. ΓòÉΓòÉΓòÉ 12.5. Defining a new table ΓòÉΓòÉΓòÉ
  4494.  
  4495. To define a new table, open the Utilities menu then select Table followed by 
  4496. Create and finally From Definition.... 
  4497.  
  4498. A dialog box is displayed. 
  4499.  
  4500. Define Table 
  4501.  
  4502. The dialog box is used to specify the details of the the table being defined. 
  4503.  
  4504.  Location     Select the Location at which the table will reside 
  4505.  Name         Enter the name of the new table 
  4506.  Comment      Enter a comment to associate with the new table 
  4507.  Convert all names to upper case Select this to ensure that the table name 
  4508.               together with all column names are treated as upper case when the 
  4509.               table is created. 
  4510.  Columns List This displays the columns that have been defined for the new 
  4511.               table. 
  4512.  Add          Press this to display the dialog from where the columns are 
  4513.               defined 
  4514.  
  4515.               Define Table - Add Column 
  4516.  
  4517.  
  4518.  Remove       Press this to delete the currently highlighted entry from the 
  4519.               columns list. 
  4520.  Index        Press this to display the dialog from where the columns to be 
  4521.               used in the index are selected. 
  4522.  
  4523.               Define Table - Define Index 
  4524.  
  4525.  
  4526.  Database     Use this field to specify in which database at the named location 
  4527.               the table will be created. 
  4528.  Tablespace   Use this field to specify in which tablespace in the named 
  4529.               database the table will be created. 
  4530.  
  4531.  Press OK to create the newly defined table. 
  4532.  
  4533.  Note:  The database and tablespace fields are required only for locations such 
  4534.  as DB2/MVS and XDB that use these concepts. If they are not specified then the 
  4535.  table will be created in the default database and tablespace at the named 
  4536.  location. 
  4537.  
  4538.  
  4539. ΓòÉΓòÉΓòÉ 12.6. Altering the definition of a table ΓòÉΓòÉΓòÉ
  4540.  
  4541. This utility allows the user to examine the column definition for an existing 
  4542. table or view. It also offers the capability to add new columns to existing 
  4543. tables (not views). 
  4544.  
  4545. To invoke this facility, open the Utilities menu and select Table followed by 
  4546. Alter Definition.... 
  4547.  
  4548. A dialog box is displayed which is used to identify the table or view. 
  4549.  
  4550. Complete the dialog box as follows. 
  4551.  
  4552.  Location       Select the location at which the table/view resides 
  4553.  Name           Enter the name of the table/view to be examined or altered, or 
  4554.                 select a name from the Name/Comment list into the field. 
  4555.  Comment        This is reference field showing any associated comment from a 
  4556.                 table/view selected from the Name/Comment List. 
  4557.  Owner List     Press the Refresh button to populate this list with all table 
  4558.                 owners at the selected location. 
  4559.  Name/Comments List Populate this list by selecting an owner from the owner 
  4560.                 list. Selecting an entry from this list will cause the Name and 
  4561.                 Comment fields to be changed to those of the selected entry. 
  4562.  Convert Table Name to Upper Case Select this option to ensure the table/view 
  4563.                 name is treated as upper case. 
  4564.  
  4565.  Press OK to display another dialog showing the column definition for the 
  4566.  selected table or view. The dialog that is displayed depends upon whether a 
  4567.  table or a view was selected. 
  4568.  
  4569.  Alter Table Definition #2 (Tables) 
  4570.  
  4571.  For tables, this secondary dialog consists of the following fields. 
  4572.  
  4573.  Columns list   List showing definition of all columns in table 
  4574.  Convert column names to upper case Select this to treat all newly defined 
  4575.                 column names as upper case. 
  4576.  Add            Press this to display a dialog from where a new column can be 
  4577.                 defined 
  4578.  
  4579.                 Alter Table Definition - Add Column 
  4580.  
  4581.  
  4582.  Delete         Use this to remove a newly defined column from the column list. 
  4583.                 The column in question must first be selected in the list. 
  4584.  
  4585.  When all new columns have been defined press Alter to update the column 
  4586.  definition. 
  4587.  
  4588.  For views, the secondary dialog is displayed thus: 
  4589.  
  4590.  Alter Table Definition #2 (Views) 
  4591.  
  4592.  Complete the dialog as follows. 
  4593.  
  4594.  Columns list   List showing definition of all columns in the view 
  4595.  View Definition This field shows the query that defines the view 
  4596.  
  4597.  When the definitions have been examined press OK to close the dialog. 
  4598.  
  4599.  
  4600. ΓòÉΓòÉΓòÉ 12.7. Erasing a table ΓòÉΓòÉΓòÉ
  4601.  
  4602. To erase a local or remote table, open the Utilities menu and select Table 
  4603. followed by Erase.... 
  4604.  
  4605. A dialog box is displayed. 
  4606.  
  4607. The dialog box is used to specify the name of the table to be erased The fields 
  4608. should be completed as follows: 
  4609.  
  4610.  Location       Select the location at which the table resides 
  4611.  Name           Enter the name of the table to be erased or select a table from 
  4612.                 the Name/Comment list into the field. 
  4613.  Comment        This is reference field showing any associated comment from a 
  4614.                 table selected from the Name/Comment List. 
  4615.  Owner List     Press the Refresh button to populate this list with all table 
  4616.                 owners at the selected location. 
  4617.  Name/Comments List Populate this list by selecting an owner from the owner 
  4618.                 list. Selecting a table from this list will cause the Name and 
  4619.                 Comment fields to be changed to the selected table. 
  4620.  Convert Table Name to Upper Case Select this option to ensure the table name 
  4621.                 is converted to upper case. 
  4622.  
  4623.  Press OK to erase the named table. 
  4624.  
  4625.  Confirmation will be requested from you before the deletion is carried out. 
  4626.  
  4627.  
  4628. ΓòÉΓòÉΓòÉ 12.8. Importing a table ΓòÉΓòÉΓòÉ
  4629.  
  4630. To import an OS/2 file into a DB2/2 table, open the Utilities menu then select 
  4631. Table followed by Create and finally From Import File.... 
  4632.  
  4633. A dialog box is displayed from where you can specify the location and type of 
  4634. the file containing the data to import. 
  4635.  
  4636. Complete the dialog as follows. 
  4637.  
  4638.  Format         Select the format of the file to import. The following formats 
  4639.                 are available 
  4640.                     Non-Delimited ASCII    (.ASC) 
  4641.                     Import Export Format   (.IXF) 
  4642.                     Comma Separated Variable (.CSV) 
  4643.                     ASCII Delimited      (.DEL) 
  4644.                     Lotus 123 spreadsheet   (.WSF) 
  4645.  Name           Enter the name of the file, or select an item into it from the 
  4646.                 Names list. 
  4647.  Directory      Enter the path of the file to be imported, or select a path 
  4648.                 from the Directories list. 
  4649.  
  4650.  Press the Import button to display another dialog 
  4651.  
  4652.  Table Import #2 
  4653.  
  4654.  This dialog enables the target table and location to be specified. Various 
  4655.  options are available dependant on the type of input file. Only IXF files 
  4656.  contain enough information to enable a new table to be created so the Create A 
  4657.  New Table option and the options to ignore codepage errors and recreate 
  4658.  indexes are only available for these files. For all other file types the data 
  4659.  can only be used against existing tables. 
  4660.  
  4661.  Descriptions of the available import methods follow: 
  4662.  
  4663.  Insert             Append the new data to an existing table without affecting 
  4664.                     the existing data. 
  4665.  Update             Add new rows for data with primary keys that are not 
  4666.                     already in the table. If the primary keys match then the 
  4667.                     existing row is updated. 
  4668.  Create A New Table Only available for IXF files. A new table will be created 
  4669.                     according to the definition held in the IXF file. 
  4670.  Replace All        All existing data in the table is removed and replaced with 
  4671.                     the data in the input file. 
  4672.  
  4673.  Note:  During the import of certain IXF files information, warning and error 
  4674.  messages are written out ot a file called MSGFILE.LOG which will be created in 
  4675.  the working directory. To view this file to check the outcome of the import 
  4676.  press the View Msg File button. 
  4677.  
  4678.  
  4679. ΓòÉΓòÉΓòÉ 12.9. Managing sessions ΓòÉΓòÉΓòÉ
  4680.  
  4681. The Sessions utilities are used to register userids and passwords which will be 
  4682. used by XY-Query when it connects to locations containing databases and tables. 
  4683.  
  4684. To log on locally, open the Utilities menu and select Sessions followed by 
  4685. Logon and then finally Local. This presents a dialog into which the local 
  4686. userid and password should be entered. XY-Query will use this information when 
  4687. it runs queries against local DB2/2 tables. 
  4688.  
  4689. To log on to a LAN node, open the Utilities menu and select Sessions followed 
  4690. by Logon and then finally Node. This presents a dialog into which the userid, 
  4691. password and node name should be entered. The Node name is the remote 
  4692. workstation where a remote database resides or the name of the DDCS/2 gateway 
  4693. workstation. XY-Query will use the userid and password when it tries to run a 
  4694. query against a table in a remote location catalogued at that node. 
  4695.  
  4696. To register your XDB userid and password to XY-Query, open the Utilities menu 
  4697. and select Sessions followed by Logon and then finally XDB. This presents a 
  4698. dialog into which the userid and password to be used when XY-Query connects to 
  4699. XDB. 
  4700.  
  4701. XDB Logon 
  4702.  
  4703. To log off a local or remote userid: 
  4704.  
  4705.    1. Open the Utilities menu and select Sessions followed by Logoff and then 
  4706.       Logoff again. 
  4707.    2. Select the session to log off from. 
  4708.    3. Press the Logoff button. 
  4709.  
  4710.  XY-Query remembers the last read-protect password you entered such that it can 
  4711.  use it when you subsequently open other read-protected objects, if they have 
  4712.  the same password then it will not prompt for a password when it is opened. To 
  4713.  remove this remembered password from XY-Query, open the Utilities menu and 
  4714.  select Sessions followed by Logoff and then Logoff Object. 
  4715.  
  4716.  
  4717. ΓòÉΓòÉΓòÉ 13. XY-Query Procedures ΓòÉΓòÉΓòÉ
  4718.  
  4719.  
  4720. ΓòÉΓòÉΓòÉ 13.1. Introduction ΓòÉΓòÉΓòÉ
  4721.  
  4722. This chapter explains how to use the Procedures Window to create and maintain 
  4723. XY-Query Procedure objects. 
  4724.  
  4725. XY-Query Procedures are written using the REXX Procedures Language giving the 
  4726. benefits of rapid data access harnessed with the flexibility and power of the 
  4727. REXX language. 
  4728.  
  4729. You can invoke XY-Query functions from any REXX program providing that it is 
  4730. executing in a Presentation Manager environment. Normal REXX command (.CMD) 
  4731. files can access the XY-Query functions as described in Running XY-Query 
  4732. remotely from REXX.  Other generic REXX application builders such as PMREXX and 
  4733. DrDialog can also utilise the XY-Query interface. 
  4734.  
  4735. To enable both XY-Query Procedures and external applications to use its 
  4736. functions, XY-Query provides a Dynamic Link Library (XYQREXFN) containing the 
  4737. entry points allowing functions to be invoked from a REXX program. For a REXX 
  4738. program to call XY-Query functions, you must temporarily extend REXX by 
  4739. defining them as external functions. 
  4740.  
  4741. A list of the functions provided to perform XY-Query tasks can be found in 
  4742. XY-Query Procedure functions. 
  4743.  
  4744. Note:  Full help on REXX is available within OS/2. 
  4745.  
  4746.  
  4747. ΓòÉΓòÉΓòÉ 13.2. Working with the procedures window ΓòÉΓòÉΓòÉ
  4748.  
  4749. The Procedure window is displayed whenever an XY-Query Procedure object is 
  4750. opened or XY-Query is invoked from the command line with the /P parameter. 
  4751.  
  4752. From this window, REXX commands are written to perform a series of tasks 
  4753. including calls to XY-Query functions. 
  4754.  
  4755. Among the functions available from the Procedure window are the following: 
  4756.  
  4757.      Procedure Creation (Creating XY-Query Procedures) 
  4758.      Running a Procedure  (Starting a Procedure) 
  4759.      Stopping a Procedure  (Stopping a Procedure) 
  4760.      Save the Procedure object (Saving from the Procedure window) 
  4761.      Copy to a new Procedure object (Copying to a new Procedure object) 
  4762.      Export a procedure (Exporting Procedures) 
  4763.      Import a new procedure (Importing Procedures) 
  4764.      Print the procedure (Printing Procedures) 
  4765.      Clipboard operations (Copying, cutting and pasting procedure text) 
  4766.      Setting Procedure characteristics (Procedure window settings) 
  4767.  
  4768.  
  4769. ΓòÉΓòÉΓòÉ 13.3. Creating XY-Query Procedures ΓòÉΓòÉΓòÉ
  4770.  
  4771. You can build procedures manually or with the help of some specific functions. 
  4772. Although the Procedure window can be used to run REXX programs with no XY-Query 
  4773. function calls, this section concentrates on how to create Procedures that use 
  4774. the functions on offer. 
  4775.  
  4776. When a new Procedures window is shown, it is pre-filled with the following code 
  4777. fragment: 
  4778.  
  4779. /* XY-Query Procedure.                               */
  4780. call RxFuncAdd 'XYQRegisterFunctions' ,,
  4781.                'XYQREXFN' ,,
  4782.                'XYQRegisterFunctions'
  4783.  
  4784. call XYQRegisterFunctions
  4785.  
  4786.  
  4787. /* Enter the body of your XY-Query Procedure here */
  4788.  
  4789.  
  4790. call XYQDeregisterFunctions
  4791. return
  4792.  
  4793. This code forms the skeleton of the procedure. It includes the functions needed 
  4794. to start and finish calling XY-Query.  See XY-Query Procedure functions for a 
  4795. full list of the XY-Query functions that can be invoked. 
  4796.  
  4797. This skeleton can be reproduced at any time by selecting the Skeleton option 
  4798. from the Procedure menu. 
  4799.  
  4800. All other calls to XY-Query functions must be made between the 
  4801. XYQRegisterFunctions and XYQDeregisterFunctions. The Models option (Using 
  4802. Procedure models)  helps to ensure that the XY-Query function calls are 
  4803. syntactically correct. 
  4804.  
  4805.  
  4806. ΓòÉΓòÉΓòÉ 13.3.1. Using Procedure models ΓòÉΓòÉΓòÉ
  4807.  
  4808. Procedure models dialog 
  4809.  
  4810. The Models option aids the building of a procedure by presenting a list of 
  4811. available functions which, when selected, are inserted at the current cursor 
  4812. position, into the Procedure editor. Each 'Model' may optionally contain 
  4813. pre-written comments explaining the function and basic error-checking code 
  4814. together with the actual function call with example parameters where required. 
  4815.  
  4816. To use the Models option: 
  4817.  
  4818.    1. Open the Procedure menu and select Models to display a dialog box. 
  4819.    2. Select the function to insert into the procedure editor. For a 
  4820.       description of the functions available, see XY-Query Procedure functions. 
  4821.    3. To add an explanatory comment in front of the function call, select 
  4822.       Comment. 
  4823.    4. To add an error check after the function call, select Error Check. This 
  4824.       inserts an unfinished conditional statement whose condition is the error 
  4825.       return code of the function.  By completing the statement, you can 
  4826.       specify the action the procedure takes in the event of an error. 
  4827.    5. Press Add to insert the Model text into the Procedure editor at the 
  4828.       current cursor position. 
  4829.  
  4830.  
  4831. ΓòÉΓòÉΓòÉ 13.4. Starting a Procedure ΓòÉΓòÉΓòÉ
  4832.  
  4833. You start a Procedure defined in the Procedure editor in one of the following 
  4834. ways: 
  4835.  
  4836.      Select the Run option  from the Procedure menu. 
  4837.      Press the Run button on the toolbar. 
  4838.      Use the Shift and F1 key combination. 
  4839.  
  4840.  Each of these reads the Procedure text from the editor and then sends it to 
  4841.  the REXX interpreter for execution. 
  4842.  
  4843.  Each XY-Query function that is called in the Procedure sends status messages 
  4844.  to be displayed on the Information Bar. Notification of completion, or 
  4845.  otherwise, is also posted on the Information Bar. If the REXX interpreter 
  4846.  detects an error, a description of the error is displayed there. 
  4847.  
  4848.  Note:  You can make a procedure return a message by using the exit or return 
  4849.  statement followed by a REXX variable or your message text.  For example, the 
  4850.  statement: 
  4851.  
  4852.   exit 'Query 1 failed'
  4853.  displays the following message in the Information Bar: 
  4854.  
  4855.   Query 1 failed
  4856.  
  4857.  Variables can also be attached to the completion message via the exit or 
  4858.  return statements; the procedure displays the contents of the variable. For 
  4859.  example: 
  4860.  
  4861.   exit 'Query 1 failed, sqlcode =' XYQSqlCode
  4862.  
  4863.  This returns the message plus the contents of the REXX variable XYQSqlCode, 
  4864.  which contains the sqlcode returned when the query was run.  The resulting 
  4865.  error message might be: 
  4866.  
  4867.   exit Query 1 failed, sqlcode= -204
  4868.  
  4869.  You can use any combination of text with the REXX variables to give meaningful 
  4870.  return or error messages on the status line when the procedure ends. For more 
  4871.  details about the REXX variables see REXX variables used by XY-Query. 
  4872.  
  4873.  
  4874. ΓòÉΓòÉΓòÉ 13.5. Stopping a Procedure ΓòÉΓòÉΓòÉ
  4875.  
  4876. If you want to stop the execution of a Procedure prematurely, select the Stop 
  4877. option of the Procedure menu or press the Stop button on the toolbar. The 
  4878. procedure ends when the current REXX statement has completed. 
  4879.  
  4880.  
  4881. ΓòÉΓòÉΓòÉ 13.6. Saving from the Procedure window ΓòÉΓòÉΓòÉ
  4882.  
  4883. To perform a save, open the File menu and select Save. This saves all 
  4884. information about the Procedure window together with the text of the procedure 
  4885. and the invocation setting. 
  4886.  
  4887.  
  4888. ΓòÉΓòÉΓòÉ 13.7. Copying to a new Procedure object ΓòÉΓòÉΓòÉ
  4889.  
  4890. To create a copy of the current XY-Query procedure object, open the File menu 
  4891. and select Copy to.... 
  4892.  
  4893. From the resulting dialog box, specify the name of the new XY-Query Procedure 
  4894. object.  Complete the fields as follows: 
  4895.  
  4896.  Format     Only format XYPROC is available 
  4897.  Name       Type a name for the new procedure.  Alternatively, use Names to 
  4898.             select a file to overwrite. 
  4899.  Directory  Type a file path for the object in the field.  Alternatively, you 
  4900.             can use Directories to select a path. 
  4901.  Names/Directories Use these fields to display the names and file paths of 
  4902.             existing XY-Query procedure objects.  If necessary, select one of 
  4903.             these and overwrite it. 
  4904.  
  4905.  Press Copy to complete the operation. 
  4906.  
  4907.  A new XY-Query procedure object is created which is identical, in all but 
  4908.  name, to the current state of the active procedure. 
  4909.  
  4910.  
  4911. ΓòÉΓòÉΓòÉ 13.8. Exporting Procedures ΓòÉΓòÉΓòÉ
  4912.  
  4913. You can export procedure text from the Procedure editor to command (.CMD) 
  4914. files. 
  4915.  
  4916. To export the procedure open the Procedure menu and select Export.... Complete 
  4917. the resulting dialog box by specifying the path and name of the file to receive 
  4918. the export. Only one export format, Command File (.CMD) is available. 
  4919.  
  4920. Complete the fields and press Export to write the procedure to the named file. 
  4921.  
  4922.  
  4923. ΓòÉΓòÉΓòÉ 13.9. Importing Procedures ΓòÉΓòÉΓòÉ
  4924.  
  4925. Procedures can be imported into the Procedure editor from either XY-Query 
  4926. Procedure objects or REXX command (.CMD) files. 
  4927.  
  4928. To import a procedure, open the Procedure menu and select Import. Complete the 
  4929. resulting dialog box by specifying the path and name of the import file. The 
  4930. correct format, either XYPROC or Command File (.CMD) must be specified. 
  4931.  
  4932. Complete the fields and press Import to retrieve the procedure from the named 
  4933. source and display it in the Procedure editor. 
  4934.  
  4935.  
  4936. ΓòÉΓòÉΓòÉ 13.10. Printing Procedures ΓòÉΓòÉΓòÉ
  4937.  
  4938. To print the procedure currently displayed in the Procedure editor open the 
  4939. File menu and select Print, or press the printer icon on the toolbar. 
  4940.  
  4941. A dialog box is displayed containing a list of all available printers: 
  4942.  
  4943.      Select a printer from the list. 
  4944.      Press the Job button to display and change the job properties for this 
  4945.       printer as required.. 
  4946.      Press the Print button to print the procedure text on the selected 
  4947.       printer. 
  4948.  
  4949.  
  4950. ΓòÉΓòÉΓòÉ 13.11. Copying, cutting and pasting procedure text ΓòÉΓòÉΓòÉ
  4951.  
  4952. You can copy and cut text from, and paste text into, the Procedure editor using 
  4953. the clipboard. Before copying or cutting text, select it, either by holding the 
  4954. left mouse button and dragging the pointer over it, or by holding down the 
  4955. Shift key and using the arrow keys to move through the text. If all text in the 
  4956. editor is required use the Select all option from the Edit menu. This 
  4957. highlights all of the text in the Procedure editor ready for Cut or Copy. 
  4958.  
  4959. To copy selected text, open the Edit menu and select Copy.  The text is copied 
  4960. to the clipboard. 
  4961.  
  4962. To cut and copy selected text, open the Edit menu and select Cut. The text is 
  4963. deleted from the text area and copied to the Clipboard. 
  4964.  
  4965. To paste text from the clipboard into the Procedure editor, position the cursor 
  4966. at the point where you want the item to be inserted, open the Edit menu and 
  4967. select Paste. The item is pasted into the text area. 
  4968.  
  4969. Note:  The Cut, Copy and Paste functions can all be invoked by using their 
  4970. respective toolbar buttons. 
  4971.  
  4972.  
  4973. ΓòÉΓòÉΓòÉ 13.12. Procedure window settings ΓòÉΓòÉΓòÉ
  4974.  
  4975. Each Procedure window has a Settings Notebook from where you can set the 
  4976. attributes and presentation styles for the window. You use the Procedure window 
  4977. settings notebook to override the default settings for the appearance of the 
  4978. Procedure window and also to decide how the Procedure object will behave in 
  4979. future. 
  4980.  
  4981. You can display the notebook in three different ways: 
  4982.  
  4983.      Select the Open Settings option of the View menu 
  4984.      Press the Settings icon on the toolbar 
  4985.      Press the right hand mouse button when the pointer is over the Procedure 
  4986.       editor. 
  4987.  
  4988.  The Procedure window settings notebook consists of three pages as follows: 
  4989.  
  4990.      Presentation page 
  4991.      Invocation page 
  4992.      Security page 
  4993.  
  4994.  Note:  In general all pages in a Settings notebook have Apply, Undo and 
  4995.  Default buttons as standard. The Apply button takes the current settings for 
  4996.  the page and applies them to the object. The Undo button sets the page 
  4997.  settings back to the state they were in at the time of the last apply. The 
  4998.  Default button causes the default settings to be reflected on the page. The 
  4999.  defaults can be application supplied or can be supplied by the XY-Query 
  5000.  Settings facility. These defaults will only be reflected in the object itself 
  5001.  if they are explicitly applied. 
  5002.  
  5003.  
  5004. ΓòÉΓòÉΓòÉ 13.12.1. Presentation page ΓòÉΓòÉΓòÉ
  5005.  
  5006. Procedure Settings - Presentation page 
  5007.  
  5008. You use the Presentation Page to set the background and text colours for the 
  5009. Procedure editor. You can also set the font in which text will be displayed in 
  5010. the editor. 
  5011.  
  5012. The defaults for this page are retrieved from the Procedure section of the 
  5013. XY-Query Settings facility. See Procedure Settings - Presentation page for more 
  5014. information. 
  5015.  
  5016.  
  5017. ΓòÉΓòÉΓòÉ 13.12.2. Invocation page ΓòÉΓòÉΓòÉ
  5018.  
  5019. You use the Invocation page to set the mode in which the Procedure is activated 
  5020. when the object is subsequently invoked. 
  5021.  
  5022. Procedure Settings - Invocation page 
  5023.  
  5024. There are three modes from which to choose: 
  5025.  
  5026.      Select Manual Run to obtain the Procedure window and run the Procedure 
  5027.       manually. This is the default state for this attribute. 
  5028.      Select Automatic Run to obtain the Procedure window and run the Procedure 
  5029.       automatically. 
  5030.      Select Background Run to run the Procedure automatically as the object is 
  5031.       invoked without showing the Procedure window. 
  5032.  
  5033.  Note:  You can access the procedure window from the task list while a 
  5034.  procedure is running in the background.  If the window is visible when the 
  5035.  procedure ends, then it stays available until closed by you.  If it is not 
  5036.  visible, then the procedure shuts down automatically when the procedure has 
  5037.  completed.  If the procedure fails for some reason while running in background 
  5038.  mode, the window is made visible so that you can investigate and the procedure 
  5039.  will not be closed automatically. 
  5040.  
  5041.  There is no immediate effect on the Procedure object by setting a mode on this 
  5042.  page.  It determines only how the Procedure will be invoked in the future. 
  5043.  
  5044.  
  5045. ΓòÉΓòÉΓòÉ 13.12.3. Security page ΓòÉΓòÉΓòÉ
  5046.  
  5047. Procedure Settings - Security page 
  5048.  
  5049. The Security page allows you to apply security measures to your XY-Query 
  5050. Procedure objects. You can specify an individual object to be Write Protected, 
  5051. Read Protected or both. 
  5052.  
  5053. By making an object write protected you can prevent users of the object from 
  5054. saving changes they may have made, either accidentally or deliberately. 
  5055.  
  5056. Setting read protection prevents unauthorised users from opening or executing 
  5057. an object. 
  5058.  
  5059. Both levels of protection rely on the use of passwords. An object can have a 
  5060. read and a write protect password. It may be that they are both the same but 
  5061. they do not need to be. It is up to the creator of the object to determine what 
  5062. level of security it requires and what the passwords should be. 
  5063.  
  5064. To set a password perform the following activities: 
  5065.  
  5066.    1. Select the required security option from the list 
  5067.  
  5068.    2. Enter the required password 
  5069.  
  5070.    3. Repeat the password in the verification field 
  5071.  
  5072.    4. Press the Set button. 
  5073.  
  5074.    5. Press the Apply button (if all activity on the page is complete) 
  5075.  
  5076.  When you set write protection on it is initially in its de-activated state. 
  5077.  This is to allow you to continue changing the object. When all changes are 
  5078.  complete you may either explicitly save or close the object. Once these 
  5079.  actions are complete full write protection for the object is activated. This 
  5080.  would mean that no further changes can be written to the object file. 
  5081.  
  5082.  If you have a write protected object you can still change it if you know the 
  5083.  correct password. The way to do this is as follows: 
  5084.  
  5085.    1. Select the Write Protection security option from the list 
  5086.  
  5087.    2. Enter the write protect password 
  5088.  
  5089.    3. Press the De-Activate button. 
  5090.  
  5091.    4. Press the Apply button (if all activity on the page is complete) 
  5092.  
  5093.  This will temporarily de-activate write protection. This means that you can 
  5094.  make changes to the object and save them. The act of saving will re-activate 
  5095.  full write protection. 
  5096.  
  5097.  Setting read protection on will cause the object file to be encrypted as it is 
  5098.  stored thus making the file unreadable using normal text editors. 
  5099.  
  5100.  You can only open a read protected object if you know the correct password. 
  5101.  When you attempt to open a read protected object a dialog box will be 
  5102.  displayed prompting you for the read protect password. 
  5103.  
  5104.  Opening a read protected procedure object 
  5105.  
  5106.  Entering the correct password here will then open the XY-Query object as 
  5107.  normal. If the password is incorrect then a warning is given and the object is 
  5108.  not opened. You have three attempts to enter the correct password before the 
  5109.  dialog will dismiss itself. 
  5110.  
  5111.  Note:  All passwords are case sensitive and retain any leading or trailing 
  5112.  spaces. 
  5113.  
  5114.  
  5115. ΓòÉΓòÉΓòÉ 13.13. Running XY-Query remotely from REXX ΓòÉΓòÉΓòÉ
  5116.  
  5117. This section explains how to run XY-Query procedures from a REXX command file 
  5118. instead of from the XY-Query Procedure Window.  To do this, you need two 
  5119. command files. The first starts the other in a Presentation Manager (PM) 
  5120. session.  This is required as XY-Query is a PM application. 
  5121.  
  5122. The following files, INVOKE.CMD and RXXYQ.CMD, are examples. To start XY-Query 
  5123. using these files, type INVOKE on a command line.  The functions used in the 
  5124. files are explained in XY-Query Procedure functions. 
  5125.  
  5126. The INVOKE.CMD file contains these statements: 
  5127.  
  5128. /* Invoke REXX XY-Query Procedure.                   */
  5129.  
  5130. /* This command file can be used to invoke another   */
  5131. /* in a Presentation Manager session. This is        */
  5132. /* required to allow XY-Query procedure functions    */
  5133. /* to be executed.                                   */
  5134.  
  5135. /* Retrieve the path of the XY-Query installation    */
  5136. /* directory and use it to construct the fully       */
  5137. /* qualified name of the command file to execute.    */
  5138.  
  5139. /* The command file that is invoked can be           */
  5140. /* found in your XY-Query installation directory.    */
  5141.  
  5142. env = 'OS2ENVIRONMENT'
  5143. xyqpath = value('XYQPATH',,env)
  5144. rxfile = xyqpath'\rxxyq.cmd'
  5145.  
  5146. '@start /pm CMD /c 'rxfile
  5147. return
  5148.  
  5149. The RXXYQ.CMD file contains these statements: 
  5150.  
  5151. /* Example XY-Query Procedure                        */
  5152.  
  5153. /* This REXX command file MUST be initiated in a     */
  5154. /* Presentation Manager Session. The relevant code   */
  5155. /* to do this can be found in file INVOKE.CMD in     */
  5156. /* your XY-Query Samples directory.                  */
  5157.  
  5158. /* It will not run correctly if it is not invoked    */
  5159. /* in this manner.                                   */
  5160.  
  5161. /* Extend REXX to enable use of the XY-Query         */
  5162. /* Procedure functions.                              */
  5163.  
  5164. call RxFuncAdd 'XYQRegisterFunctions' ,,
  5165.                'XYQREXFN' ,,
  5166.                'XYQRegisterFunctions'
  5167. call XYQRegisterFunctions
  5168.  
  5169. /* Retrieve the XY-Query Install directory path.     */
  5170. /* The XY-Query object containing the query to       */
  5171. /* run is referred to in the variable XYQOBJ. This   */
  5172. /* is the SERVICE object in the SAMPLES directory.   */
  5173.  
  5174. env = 'OS2ENVIRONMENT'
  5175. xyqpath = value('XYQPATH',,env)
  5176. XYQOBJ  = xyqpath'\SAMPLES\SERVICE'
  5177.  
  5178. /* Set a value which will be used as a parameter to  */
  5179. /* the query held in the object to be run.           */
  5180.  
  5181. rx_years=5
  5182.  
  5183. /*****************************************************/
  5184.  
  5185. /*****************************************************/
  5186. /* Execute the query held in the object SERVICE and  */
  5187. /* automatically substitute the value 5 for the      */
  5188. /* variable called years.                            */
  5189. /*****************************************************/
  5190.  
  5191. call XYQRunQuery XYQOBJ , 'years='rx_years
  5192. if (XYQRc <> 0)
  5193. then
  5194.  XYQMsg = RxMessageBox('Error 'XYQRc ,
  5195.                        'SQLCODE = 'XYQSQLCode ,,
  5196.                        'Run SERVICE Query' ,,
  5197.                        'OK')
  5198. else
  5199.  XYQMsg = RxMessageBox('SERVICE Completed OK.' ,
  5200.                        'Rows='XYQRows 'Cols='XYQCols,,
  5201.                        'Run SERVICE Query' ,,
  5202.                        'OK')
  5203.  
  5204. /*****************************************************/
  5205. /* Display the XY-Query Viewer to show the data.     */
  5206. /*****************************************************/
  5207.  
  5208. call XYQShowViewer XYQOBJ
  5209. if (XYQRc <> 0)
  5210. then
  5211.  XYQMsg = RxMessageBox('Error 'XYQRc ,,
  5212.                        'Show Viewer' ,,
  5213.                        'OK')
  5214. else
  5215.  XYQMsg = RxMessageBox('Viewer Displayed OK' ,,
  5216.                        'Show Viewer' ,,
  5217.                        'OK')
  5218.  
  5219. /*****************************************************/
  5220.  
  5221. /*****************************************************/
  5222. /* Show the data in a chart using display attributes */
  5223. /* defined in the SERVICE object.                    */
  5224. /*****************************************************/
  5225.  
  5226. call XYQShowChart XYQOBJ
  5227. if (XYQRc <> 0)
  5228. then
  5229.  XYQMsg = RxMessageBox('Error 'XYQRc ,,
  5230.                        'Show Chart' ,,
  5231.                        'OK')
  5232. else
  5233.  XYQMsg = RxMessageBox('Chart Displayed OK' ,,
  5234.                        'Show Chart' ,,
  5235.                        'OK')
  5236.  
  5237. /*****************************************************/
  5238. /* Clean up and de-register functions from REXX      */
  5239. /*****************************************************/
  5240.  
  5241. call XYQTerminate
  5242. call XYQDeregisterFunctions
  5243.  
  5244. XYQMsg = RxMessageBox('Procedure Completed' ,,
  5245.                       'XY-Query Procedure'  ,,
  5246.                       'OK')
  5247. return
  5248.  
  5249. Note:  The XYQTerminate call is required when XY-Query functions are called 
  5250. from outside of the XY-Query Procedure window. 
  5251.  
  5252.  
  5253. ΓòÉΓòÉΓòÉ 13.13.1. Tracing XY-Query Procedures ΓòÉΓòÉΓòÉ
  5254.  
  5255. If you have to perform a trace on an executing REXX procedure, then change the 
  5256. INVOKE.CMD file as follows: 
  5257.  
  5258. /* Invoke REXX XY-Query Procedure.                   */
  5259. /* Write trace messages to a named file.             */
  5260.  
  5261. /* This command file can be used to invoke another   */
  5262. /* in a Presentation Manager session. This is        */
  5263. /* required to allow XY-Query procedure functions to */
  5264. /* be executed.                                      */
  5265.  
  5266. /* The command file that is invoked can be           */
  5267. /* found in your XY-Query installation directory.    */
  5268.  
  5269. /* Retrieve the path of the XY-Query installation    */
  5270. /* directory and use it construct the name of the    */
  5271. /* command file to execute.                          */
  5272.  
  5273. env = 'OS2ENVIRONMENT'
  5274. xyqpath = value('XYQPATH',,env)
  5275. rxfile  = xyqpath'\rxxyqtrc.cmd'
  5276.  
  5277. /* Construct trace file name to be written into      */
  5278. /* install directory.                                */
  5279.  
  5280. trcfile = xyqpath'\xyq.trc'
  5281.  
  5282. /* Invoke procedure with trace messages being        */
  5283. /* written to a file.                                */
  5284.  
  5285. '@start /pm CMD /c 'rxfile ' 2>'trcfile
  5286. return
  5287.  
  5288. Include the statement trace r in the invoked command file (rxxyqtrc.cmd) to get 
  5289. the trace messages written. 
  5290.  
  5291.  
  5292. ΓòÉΓòÉΓòÉ 13.14. XY-Query Procedure functions ΓòÉΓòÉΓòÉ
  5293.  
  5294. The full list of available XY-Query Procedure functions follows 
  5295. (alphabetically): 
  5296.  
  5297.      XYQCreateTable 
  5298.      XYQDeregisterFunctions 
  5299.      XYQEraseTable 
  5300.      XYQFileData 
  5301.      XYQFirstColName 
  5302.      XYQFirstHeading 
  5303.      XYQGetAllAttributes 
  5304.      XYQGetAllHeadings 
  5305.      XYQGetAllColNames 
  5306.      XYQGetColHeading 
  5307.      XYQGetColName 
  5308.      XYQGetDataItem 
  5309.      XYQGetDataRow 
  5310.      XYQPrintChart 
  5311.      XYQPrintViewer 
  5312.      XYQRegisterFunctions 
  5313.      XYQRunChart 
  5314.      XYQRunQuery 
  5315.      XYQRunSQL 
  5316.      XYQRunViewer 
  5317.      XYQShowChart 
  5318.      XYQShowViewer 
  5319.      XYQTerminate 
  5320.      XYQTopOfData 
  5321.  
  5322.  The REXX variable XYQRc returned by each function contains the value 0 if the 
  5323.  function completed successfully.  If not, it contains a textual description of 
  5324.  the error. This and other REXX variables used by XY-Query are detailed in REXX 
  5325.  variables used by XY-Query. 
  5326.  
  5327.  Detailed descriptions of these functions follow. 
  5328.  
  5329.  
  5330. ΓòÉΓòÉΓòÉ 13.14.1. XYQCreateTable ΓòÉΓòÉΓòÉ
  5331.  
  5332. This function saves the data returned from the last query run to a named table. 
  5333. Using this function, you can create new tables or append data onto existing 
  5334. tables. 
  5335.  
  5336.  
  5337. ΓòÉΓòÉΓòÉ 13.14.1.1. Input Parameters ΓòÉΓòÉΓòÉ
  5338.  
  5339.  Parameter #1  Name of the location at which to create the table 
  5340.  Parameter #2  Name of the table to create 
  5341.  Parameter #3  Comment on the table 
  5342.  Parameter #4  'A' - append to existing table 'R' - replace if exists 
  5343.  Parameter #5 (optional) Name of the database at the named location in which 
  5344.                the table will be created. 
  5345.  Parameter #6 (optional) Name of the tablespace in the named database in which 
  5346.                the table will be created. 
  5347.  
  5348.  
  5349. ΓòÉΓòÉΓòÉ 13.14.1.2. Returns ΓòÉΓòÉΓòÉ
  5350.  
  5351.      REXX variable XYQRc 
  5352.            Value             Description 
  5353.       0                      Table has been created successfully. 
  5354.       Invalid number of arguments An incorrect number of parameters have been 
  5355.                              specified 
  5356.       Invalid argument       At least one parameter is invalid 
  5357.       No data to save        There is no data currently held which can be used 
  5358.                              to create a table. 
  5359.       Unknown Action         Action flag (Parameter #4) is not blank or 'A' or 
  5360.                              'R'. 
  5361.       Invalid location       Location specified (Parameter #1) is not known. 
  5362.       Create failed          The Create request has failed. 
  5363.      REXX variable XYQSqlCode containing the sqlcode value for the cases where 
  5364.       a create request fails. 
  5365.      REXX variable XYQSqlMsg containing the textual description of the error 
  5366.       sqlcode. 
  5367.  
  5368.  
  5369. ΓòÉΓòÉΓòÉ 13.14.1.3. Example ΓòÉΓòÉΓòÉ
  5370.  
  5371. /* Create a table called TEMPTAB at the              */
  5372. /* location called SAMPLE                            */
  5373. call XYQCreateTable 'SAMPLE' ,,
  5374.                     'TEMPTAB' ,,
  5375.                     'A Temporary table' ,,
  5376.                     'R'
  5377.  
  5378. Note:  oompact. 
  5379.  
  5380.    1. The table name parameter is case sensitive. The table is created exactly 
  5381.       as stated in the parameter. This means that, for example, table TEMPTAB 
  5382.       can be created as well as table temptab 
  5383.  
  5384.    2. If Append is requested and the table does not already exist, the request 
  5385.       is treated as a normal create. 
  5386.  
  5387.  
  5388. ΓòÉΓòÉΓòÉ 13.14.2. XYQDeregisterFunctions ΓòÉΓòÉΓòÉ
  5389.  
  5390. This function de-registers all XY-Query functions. You can include it after the 
  5391. XYQTerminate request in the command file. It de-registers the functions across 
  5392. the WHOLE OS/2 system. For this reason, you must use it carefully, or other 
  5393. procedures running concurrently will be affected by the de-registering of 
  5394. functions they need to use. 
  5395.  
  5396.  
  5397. ΓòÉΓòÉΓòÉ 13.14.2.1. Input Parameters ΓòÉΓòÉΓòÉ
  5398.  
  5399. NONE. 
  5400.  
  5401.  
  5402. ΓòÉΓòÉΓòÉ 13.14.2.2. Returns ΓòÉΓòÉΓòÉ
  5403.  
  5404.      REXX variable XYQRc 
  5405.            Value         Description 
  5406.       0                  Functions deregistered successfully 
  5407.  
  5408.  
  5409. ΓòÉΓòÉΓòÉ 13.14.2.3. Example ΓòÉΓòÉΓòÉ
  5410.  
  5411. call XYQDeregisterFunctions
  5412.  
  5413.  
  5414. ΓòÉΓòÉΓòÉ 13.14.3. XYQEraseTable ΓòÉΓòÉΓòÉ
  5415.  
  5416. This function erases a table or view from a named location. 
  5417.  
  5418.  
  5419. ΓòÉΓòÉΓòÉ 13.14.3.1. Input Parameters ΓòÉΓòÉΓòÉ
  5420.  
  5421.  Parameter #1  Name of the location at which the table exists. 
  5422.  Parameter #2  Name of the table to erase. 
  5423.  
  5424.  
  5425. ΓòÉΓòÉΓòÉ 13.14.3.2. Returns ΓòÉΓòÉΓòÉ
  5426.  
  5427.      REXX variable XYQRc 
  5428.            Value             Description 
  5429.       0                      Table erased successfully 
  5430.       Invalid number of arguments An incorrect number of parameters have been 
  5431.                              specified 
  5432.       Invalid argument       At least one parameter is invalid 
  5433.       Erase failed           The erase request failed to complete successfully 
  5434.       Erase cancelled        The erase request was cancelled at time of 
  5435.                              confirmation 
  5436.      REXX variable XYQSqlCode containing the sqlcode value for the cases where 
  5437.       an erase request fails. 
  5438.      REXX variable XYQSqlMsg containing the textual description of the error 
  5439.       sqlcode. 
  5440.  
  5441.  
  5442. ΓòÉΓòÉΓòÉ 13.14.3.3. Example ΓòÉΓòÉΓòÉ
  5443.  
  5444. /* Erase table TEMPTAB from the sample location      */
  5445.  
  5446. call XYQEraseTable 'SAMPLE' , 'TEMPTAB'
  5447.  
  5448. Note:  The table name parameter is case sensitive. The table erased will be 
  5449. exactly as stated in the parameter. This allows differentiation between tables 
  5450. called for example, TEMPTAB and temptab 
  5451.  
  5452.  
  5453. ΓòÉΓòÉΓòÉ 13.14.4. XYQFileData ΓòÉΓòÉΓòÉ
  5454.  
  5455. This function files the data returned from the last query run. The type of 
  5456. filing is determined by the file extension, but you can override this by 
  5457. including a second parameter. You can file data to the following types of file: 
  5458.  
  5459.      .TXT  (plain text) 
  5460.      .CSV  (comma separated variable) 
  5461.      .DEL  (delimited ASCII) 
  5462.      .DIF  (standard, extended and with headings in data) 
  5463.      .WSF  (Lotus 1-2-3 format) 
  5464.      .MET  (Metafile format) 
  5465.  By default, data is filed to a .TXT file. 
  5466.  
  5467.  
  5468. ΓòÉΓòÉΓòÉ 13.14.4.1. Input Parameters ΓòÉΓòÉΓòÉ
  5469.  
  5470.  Parameter #1  Name of the file to create 
  5471.  Parameter #2  Type of file - override of file extension (optional). 
  5472.                    TXT 
  5473.                    CSV 
  5474.                    DEL 
  5475.                    DIF 
  5476.                    DIFS 
  5477.                    DIFE 
  5478.                    DIFD 
  5479.                    WSF 
  5480.                    MET 
  5481.  
  5482.  
  5483. ΓòÉΓòÉΓòÉ 13.14.4.2. Returns ΓòÉΓòÉΓòÉ
  5484.  
  5485.      REXX variable XYQRc 
  5486.            Value             Description 
  5487.       0                      Data written to file successfully 
  5488.       Invalid number of arguments An incorrect number of parameters have been 
  5489.                              specified 
  5490.       Invalid argument       At least one parameter is invalid 
  5491.       No data to file        There is no data currently held which can be 
  5492.                              written to file. 
  5493.       File failed            The file request failed to complete successfully 
  5494.  
  5495.  
  5496. ΓòÉΓòÉΓòÉ 13.14.4.3. Example ΓòÉΓòÉΓòÉ
  5497.  
  5498. /* Use extended DIF as default */
  5499. Call XYQFileData 'C:\XYQUERY\WORK\DATA.DIF'
  5500. /* Request that DIF with headings format be used */
  5501. Call XYQFileData 'C:\XYQUERY\WORK\DATA.DIF' , 'DIFD'
  5502. /* Create file in default TXT format */
  5503. Call XYQFileData 'C:\XYQUERY\WORK\DATA.XXX'
  5504. /* Create file in CSV format */
  5505. Call XYQFileData 'C:\XYQUERY\WORK\DATA.XXX' , 'CSV'
  5506.  
  5507.  
  5508. ΓòÉΓòÉΓòÉ 13.14.5. XYQFirstColName ΓòÉΓòÉΓòÉ
  5509.  
  5510. This function resets the real column name fetching process so that when 
  5511. XYQGetColName is called again, it starts at the first column name. 
  5512.  
  5513.  
  5514. ΓòÉΓòÉΓòÉ 13.14.5.1. Input Parameters ΓòÉΓòÉΓòÉ
  5515.  
  5516. NONE. 
  5517.  
  5518.  
  5519. ΓòÉΓòÉΓòÉ 13.14.5.2. Returns ΓòÉΓòÉΓòÉ
  5520.  
  5521.      REXX variable XYQRc 
  5522.            Value          Description 
  5523.       0                   Fetching process reset to first column name 
  5524.       No data to show     There is no data currently held. 
  5525.  
  5526.  
  5527. ΓòÉΓòÉΓòÉ 13.14.5.3. Example ΓòÉΓòÉΓòÉ
  5528.  
  5529. call XYQFirstColName
  5530.  
  5531.  
  5532. ΓòÉΓòÉΓòÉ 13.14.6. XYQFirstHeading ΓòÉΓòÉΓòÉ
  5533.  
  5534. This function resets the user-tailored column heading fetching process so that 
  5535. when XYQGetColHeading is called again it starts at the first column heading. 
  5536.  
  5537.  
  5538. ΓòÉΓòÉΓòÉ 13.14.6.1. Input Parameters ΓòÉΓòÉΓòÉ
  5539.  
  5540. NONE. 
  5541.  
  5542.  
  5543. ΓòÉΓòÉΓòÉ 13.14.6.2. Returns ΓòÉΓòÉΓòÉ
  5544.  
  5545.      REXX variable XYQRc 
  5546.            Value         Description 
  5547.       0                  Fetching process reset to first column heading 
  5548.       No data to show    There is no data currently held. 
  5549.  
  5550.  
  5551. ΓòÉΓòÉΓòÉ 13.14.6.3. Example ΓòÉΓòÉΓòÉ
  5552.  
  5553. call XYQFirstHeading
  5554.  
  5555.  
  5556. ΓòÉΓòÉΓòÉ 13.14.7. XYQGetAllAttributes ΓòÉΓòÉΓòÉ
  5557.  
  5558. This function retrieves the attributes of the columns retrieved by the last 
  5559. query run. The attributes are put into a two dimensional REXX array called by 
  5560. default XYQAttributes although you can override this. 
  5561.  
  5562. The returned array is referenced thus, XYQAttributes.x.y and contains 
  5563. information as follows: 
  5564.  
  5565.      Column Type 
  5566.      Column Size (maximum) 
  5567.      Whether or not the column can contain null values 
  5568.  
  5569.  The array elements referenced by XYQAttributes.0.y contain the number of 
  5570.  columns for which information is being returned. The column attributes start 
  5571.  at element XYQAttributes.1.y. 
  5572.  
  5573.  The Column Type information can include data such as CHAR or INTEGER and can 
  5574.  be accessed as follows, XYQAttributes.x.0. 
  5575.  
  5576.  The Column Size information gives the maximum size of data in the column. The 
  5577.  information can be accessed as follows, XYQAttributes.x.1. 
  5578.  
  5579.  The Nulls information is either NULL or NOT NULL to indicate whether the 
  5580.  column can contain null data. The information can be accessed as follows, 
  5581.  XYQAttributes.x.2. 
  5582.  
  5583.  
  5584. ΓòÉΓòÉΓòÉ 13.14.7.1. Input Parameters ΓòÉΓòÉΓòÉ
  5585.  
  5586.  Parameter #1  Name of REXX array to populate with attributes (optional). 
  5587.  
  5588.                If a parameter is not specified, data is returned in the array 
  5589.                XYQAttributes. 
  5590.  
  5591.  
  5592. ΓòÉΓòÉΓòÉ 13.14.7.2. Returns ΓòÉΓòÉΓòÉ
  5593.  
  5594.      REXX variable XYQRc 
  5595.            Value             Description 
  5596.       0                      All attributes have been retrieved successfully 
  5597.       Invalid number of arguments An incorrect number of parameters have been 
  5598.                              specified 
  5599.       Invalid argument       At least one parameter is invalid 
  5600.       No data to show        There is no data currently held which can be 
  5601.                              retrieved. 
  5602.      REXX array variable XYQAttributes or supplied array name 
  5603.  
  5604.       Contains all column attributes. 
  5605.  
  5606.  
  5607. ΓòÉΓòÉΓòÉ 13.14.7.3. Example ΓòÉΓòÉΓòÉ
  5608.  
  5609. Call XYQGetAllAttributes
  5610.  
  5611. if (XYQRc <> 0)
  5612. then
  5613. do
  5614.   XYQMsg = RxMessageBox('Error ' XYQRc ,,
  5615.                   'Error from XYQGetAllAttributes' ,,
  5616.                   'OK')
  5617.   exit
  5618. end
  5619. else
  5620.   XYQMsg = RxMessageBox('Column attributes retrieved',,
  5621.                         'XYQGetAllAttributes' ,,
  5622.                         'OK')
  5623.  
  5624. do i= 1 to XYQAttributes.0.0
  5625.    XYQMsg = RxMessageBox('Type of column 'i ' = ',
  5626.                           XYQAttributes.i.0  ,,
  5627.                          'Column Type Attribute' ,,
  5628.                          'OK')
  5629.    XYQMsg = RxMessageBox('Size of column 'i ' = ',
  5630.                           XYQAttributes.i.1  ,,
  5631.                          'Column Size Attribute' ,,
  5632.                          'OK')
  5633.    XYQMsg = RxMessageBox('Nulls for column 'i ' = ',
  5634.                           XYQAttributes.i.2 ,,
  5635.                          'Nulls Attribute' ,,
  5636.                          'OK')
  5637. end
  5638.  
  5639.  
  5640. ΓòÉΓòÉΓòÉ 13.14.8. XYQGetAllColNames ΓòÉΓòÉΓòÉ
  5641.  
  5642. This function retrieves the real column names, as stated in the table 
  5643. definition, from the last query run. The headings are put into a REXX array 
  5644. called by default XYQColNames although you can override this.  The zero element 
  5645. of the array contains the number of names it contains. 
  5646.  
  5647. To retrieve any user-defined column titles after executing a query held in an 
  5648. XY-Query object, use the function XYQGetAllHeadings. 
  5649.  
  5650.  
  5651. ΓòÉΓòÉΓòÉ 13.14.8.1. Input Parameters ΓòÉΓòÉΓòÉ
  5652.  
  5653.  Parameter #1      Name of REXX array to populate with column names (optional). 
  5654.  
  5655.                    If a parameter is not specified, data is returned in the 
  5656.                    array XYQColNames. 
  5657.  
  5658.  
  5659. ΓòÉΓòÉΓòÉ 13.14.8.2. Returns ΓòÉΓòÉΓòÉ
  5660.  
  5661.      REXX variable XYQRc 
  5662.            Value             Description 
  5663.       0                      All column names have been retrieved successfully 
  5664.       Invalid number of arguments An incorrect number of parameters have been 
  5665.                              specified 
  5666.       Invalid argument       At least one parameter is invalid 
  5667.       No data to show        There is no data currently held which can be 
  5668.                              retrieved. 
  5669.      REXX variable XYQColNames or supplied array name 
  5670.  
  5671.       Contains all column names. 
  5672.  
  5673.  
  5674. ΓòÉΓòÉΓòÉ 13.14.8.3. Example ΓòÉΓòÉΓòÉ
  5675.  
  5676. call XYQGetAllColNames
  5677.  
  5678. if (XYQRc <> 0)
  5679. then
  5680. do
  5681.   XYQMsg = RxMessageBox('Error ' XYQRc ,,
  5682.                    'Error from XYQGetAllColNames' ,,
  5683.                    'OK')
  5684.   exit
  5685. end
  5686. else
  5687.   XYQMsg = RxMessageBox('All column names retrieved',,
  5688.                         'XYQGetAllColNames' ,,
  5689.                         'OK')
  5690.  
  5691. do i= 1 to XYQColNames.0
  5692.    XYQMsg = RxMessageBox('Name of column 'i ' = ',
  5693.                           XYQColNames.i  ,,
  5694.                          'Column Name' ,,
  5695.                          'OK')
  5696.    end
  5697. end
  5698.  
  5699.  
  5700. ΓòÉΓòÉΓòÉ 13.14.9. XYQGetAllHeadings ΓòÉΓòÉΓòÉ
  5701.  
  5702. This function retrieves all column headings from the last query run. It 
  5703. retrieves the column titles that you have defined and stored in an object, and 
  5704. not the column names as held in the table definition. The headings are put into 
  5705. a REXX array called by default XYQHeadings although you can override this. The 
  5706. zero element of the array contains the number of headings it contains. 
  5707.  
  5708. To obtain the real column names as held in the table definition, use the 
  5709. function XYQGetAllColNames. 
  5710.  
  5711.  
  5712. ΓòÉΓòÉΓòÉ 13.14.9.1. Input Parameters ΓòÉΓòÉΓòÉ
  5713.  
  5714.  Parameter #1  Name of REXX array to populate with headings (optional). 
  5715.  
  5716.                If a parameter is not specified, the data is returned in the 
  5717.                array XYQHeadings. 
  5718.  
  5719.  
  5720. ΓòÉΓòÉΓòÉ 13.14.9.2. Returns ΓòÉΓòÉΓòÉ
  5721.  
  5722.      REXX variable XYQRc 
  5723.            Value             Description 
  5724.       0                      All column headings have been retrieved 
  5725.                              successfully 
  5726.       Invalid number of arguments An incorrect number of parameters have been 
  5727.                              specified 
  5728.       Invalid argument       At least one parameter is invalid 
  5729.       No data to show        There is no data currently held which can be 
  5730.                              retrieved. 
  5731.      REXX variable XYQHeadings or supplied array name 
  5732.  
  5733.       Contains all column headings. 
  5734.  
  5735.  
  5736. ΓòÉΓòÉΓòÉ 13.14.9.3. Example ΓòÉΓòÉΓòÉ
  5737.  
  5738. call XYQGetAllHeadings
  5739.  
  5740. if (XYQRc <> 0)
  5741. then
  5742. do
  5743.   XYQMsg = RxMessageBox('Error ' XYQRc ,,
  5744.                    'Error from XYQGetAllHeadings',,
  5745.                    'OK')
  5746.   exit
  5747. end
  5748. else
  5749.   XYQMsg = RxMessageBox('Column headings retrieved' ,,
  5750.                         'XYQGetAllHeadings' ,,
  5751.                         'OK')
  5752.  
  5753. /* Get heading details from array                    /
  5754.  
  5755. do i= 1 to XYQHeadings.0
  5756.    XYQMsg = RxMessageBox('Column heading 'i ' = ',
  5757.                           XYQHeadings.i  ,,
  5758.                          'Column Heading' ,
  5759.                          , 'OK')
  5760. end
  5761.  
  5762.  
  5763. ΓòÉΓòÉΓòÉ 13.14.10. XYQGetColHeading ΓòÉΓòÉΓòÉ
  5764.  
  5765. This function retrieves a column heading from the last query run. Any 
  5766. user-defined column titles are retrieved using this function. 
  5767.  
  5768. To obtain the real column name as held in the table definition, use the 
  5769. function XYQGetColName. 
  5770.  
  5771.  
  5772. ΓòÉΓòÉΓòÉ 13.14.10.1. Input Parameters ΓòÉΓòÉΓòÉ
  5773.  
  5774. NONE. 
  5775.  
  5776.  
  5777. ΓòÉΓòÉΓòÉ 13.14.10.2. Returns ΓòÉΓòÉΓòÉ
  5778.  
  5779.      REXX variable XYQRc 
  5780.            Value            Description 
  5781.       0                     The column heading has been retrieved successfully 
  5782.       No data to show       There is no data currently held which can be 
  5783.                             retrieved. 
  5784.       End of data reached   All column headings have already been individually 
  5785.                             retrieved. Reset the fetching pointer by issuing a 
  5786.                             XYQFirstHeading request. 
  5787.      REXX variable XYQColHead 
  5788.  
  5789.       Contains a column heading. 
  5790.  
  5791.  
  5792. ΓòÉΓòÉΓòÉ 13.14.10.3. Example ΓòÉΓòÉΓòÉ
  5793.  
  5794. call XYQGetColHeading
  5795.  
  5796. if (XYQRc <> 0)
  5797. then
  5798.   XYQMsg = RxMessageBox('Error ' XYQRc ,,
  5799.                    'Error from XYQGetColHeading' ,,
  5800.                    'OK')
  5801. else
  5802.   XYQMsg = RxMessageBox('Column heading = ',
  5803.                          XYQColHead ,,
  5804.                         'XYQGetColHeading' ,,
  5805.                         'OK')
  5806.  
  5807.  
  5808. ΓòÉΓòÉΓòÉ 13.14.11. XYQGetColName ΓòÉΓòÉΓòÉ
  5809.  
  5810. This function retrieves a column name from the last query run. It returns the 
  5811. real column name as held in the table definition and not any user-tailored 
  5812. column title. 
  5813.  
  5814. To obtain the user-tailored column titles, use the function XYQGetColHeading. 
  5815.  
  5816.  
  5817. ΓòÉΓòÉΓòÉ 13.14.11.1. Input Parameters ΓòÉΓòÉΓòÉ
  5818.  
  5819. NONE. 
  5820.  
  5821.  
  5822. ΓòÉΓòÉΓòÉ 13.14.11.2. Returns ΓòÉΓòÉΓòÉ
  5823.  
  5824.      REXX variable XYQRc 
  5825.            Value            Description 
  5826.       0                     The column heading has been retrieved successfully 
  5827.       No data to show       There is no data currently held which can be 
  5828.                             retrieved. 
  5829.       End of data reached   All column names have already been individually 
  5830.                             retrieved. Reset the fetching pointer by issuing a 
  5831.                             XYQFirstColName request. 
  5832.      REXX variable XYQColName 
  5833.  
  5834.       Contains a column name. 
  5835.  
  5836.  
  5837. ΓòÉΓòÉΓòÉ 13.14.11.3. Example ΓòÉΓòÉΓòÉ
  5838.  
  5839. call XYQGetColName
  5840.  
  5841. if (XYQRc <> 0)
  5842. then
  5843.   XYQMsg = RxMessageBox('Error ' XYQRc ,,
  5844.                         'Error from XYQGetColName' ,,
  5845.                         'OK')
  5846. else
  5847.   XYQMsg = RxMessageBox('Column name = ',
  5848.                          XYQColName ,,
  5849.                         'XYQGetColName' ,,
  5850.                         'OK')
  5851.  
  5852.  
  5853. ΓòÉΓòÉΓòÉ 13.14.12. XYQGetDataItem ΓòÉΓòÉΓòÉ
  5854.  
  5855. This function retrieves an element of data from the last query run. Data is 
  5856. retrieved row by row, a column at a time. 
  5857.  
  5858.  
  5859. ΓòÉΓòÉΓòÉ 13.14.12.1. Input Parameters ΓòÉΓòÉΓòÉ
  5860.  
  5861. NONE. 
  5862.  
  5863.  
  5864. ΓòÉΓòÉΓòÉ 13.14.12.2. Returns ΓòÉΓòÉΓòÉ
  5865.  
  5866.      REXX variable XYQRc 
  5867.            Value            Description 
  5868.       0                     The data item has been retrieved successfully 
  5869.       No data to show       There is no data currently held which can be 
  5870.                             retrieved. 
  5871.       End of data reached   All data items have already been individually 
  5872.                             retrieved. Reset the fetching pointer by issuing a 
  5873.                             XYQTopOfData request. 
  5874.      REXX variable XYQDataItem 
  5875.  
  5876.       Contains the column data. 
  5877.  
  5878.  
  5879. ΓòÉΓòÉΓòÉ 13.14.12.3. Example ΓòÉΓòÉΓòÉ
  5880.  
  5881. call XYQGetDataItem
  5882.  
  5883. if (XYQRc <> 0)
  5884. then
  5885.   XYQMsg = RxMessageBox('Error ' XYQRc ,,
  5886.                         'Error from XYQGetDataItem',,
  5887.                         'OK')
  5888. else
  5889.   XYQMsg = RxMessageBox('Data item = ' XYQDataItem ,,
  5890.                         'XYQGetDataItem' ,,
  5891.                         'OK')
  5892.  
  5893. Note:  The user defined REXX variable XYQFormat is interrogated by this 
  5894. function to determine whether or not to perform any formatting on the data 
  5895. elements returned. If it is set to NO (the default value), the raw data as held 
  5896. in the table is returned. If this value is set to YES, the data returned is 
  5897. subject to the formatting options as defined in the Language and Date/Time 
  5898. pages of the General section of the XY-Query settings facility. 
  5899.  
  5900. For example, with XYQFormat set to YES, then the data 18,230.32 can be returned 
  5901. from a decimal field. If the formatting was off, then the data returned would 
  5902. be 18230.32 This difference is important if the data is to be subsequently used 
  5903. as variables in another SQL query. SQL syntax does not allow the data 18,230.32 
  5904. to be used because of the formatting information. 
  5905.  
  5906.  
  5907. ΓòÉΓòÉΓòÉ 13.14.13. XYQGetDataRow ΓòÉΓòÉΓòÉ
  5908.  
  5909. This function retrieves a whole row of data from the last query run. An 
  5910. XYQGetDataItem call following it retrieves the first element of the next row. 
  5911.  
  5912. The data items are put into a REXX array called by default XYQDataRow although 
  5913. you can override this. The zero element of the array contains the number of 
  5914. data items retrieved. 
  5915.  
  5916.  
  5917. ΓòÉΓòÉΓòÉ 13.14.13.1. Input Parameters ΓòÉΓòÉΓòÉ
  5918.  
  5919.  Parameter #1  Name of REXX array to populate with data (optional). 
  5920.  
  5921.                If a parameter is not specified, data is returned in the default 
  5922.                array XYQDataRow. The array is referenced in the procedure by 
  5923.                XYQDataRow.0, XYQDataRow.1 etc.. 
  5924.  
  5925.  
  5926. ΓòÉΓòÉΓòÉ 13.14.13.2. Returns ΓòÉΓòÉΓòÉ
  5927.  
  5928.      REXX variable XYQRc 
  5929.            Value             Description 
  5930.       0                      The data item has been retrieved successfully 
  5931.       Invalid number of arguments An incorrect number of parameters have been 
  5932.                              specified 
  5933.       Invalid argument       At least one parameter is invalid 
  5934.       No data to show        There is no data currently held which can be 
  5935.                              retrieved. 
  5936.       End of data reached    All data items have already been individually 
  5937.                              retrieved. Reset the fetching pointer by issuing a 
  5938.                              XYQTopOfData request. 
  5939.      REXX variable XYQDataRow or supplied array name 
  5940.  
  5941.       Contains the row data. 
  5942.  
  5943.  
  5944. ΓòÉΓòÉΓòÉ 13.14.13.3. Example ΓòÉΓòÉΓòÉ
  5945.  
  5946. Call XYQGetDataRow
  5947.  
  5948. if (XYQRc <> 0)
  5949. then
  5950. do
  5951.   XYQMsg = RxMessageBox('Error ' XYQRc ,,
  5952.                         'Error from XYQGetDataRow' ,,
  5953.                         'OK')
  5954.   exit
  5955. end
  5956. else
  5957.   XYQMsg = RxMessageBox('Row of data retrieved' ,,
  5958.                         'XYQGetDataRow' ,,
  5959.                         'OK')
  5960.  
  5961. do i= 1 to XYQDataRow.0
  5962.    XYQMsg = RxMessageBox('Data item 'i ' = ' ,
  5963.                           XYQDataRow.i ,,
  5964.                          'Data Item' ,,
  5965.                          'OK')
  5966. end
  5967.  
  5968. Note:  The user defined REXX variable XYQFormat is interrogated by this 
  5969. function to determine whether or not to perform any formatting on the data 
  5970. elements returned. If it is set to NO (the default value), the raw data as held 
  5971. in the database is returned. If this value is set to YES, the data returned is 
  5972. subject to the formatting options as defined in the Language and Date/Time 
  5973. pages of the General section of the XY-Query settings facility. 
  5974.  
  5975. For example, with XYQFormat set to YES then the data 18,230.32 can be returned 
  5976. from a decimal field. If the formatting was off, the data returned would be 
  5977. 18230.32 This difference is important if the data is to be subsequently used as 
  5978. as variables in another SQL query. SQL syntax does not allow the data 18,230.32 
  5979. to be used because of the formatting information. 
  5980.  
  5981.  
  5982. ΓòÉΓòÉΓòÉ 13.14.14. XYQPrintChart ΓòÉΓòÉΓòÉ
  5983.  
  5984. This function prints a chart, constructed from the data from the last query 
  5985. run, to a specified printer, with, optionally, chart style settings from a 
  5986. named XY-Query object. 
  5987.  
  5988.  
  5989. ΓòÉΓòÉΓòÉ 13.14.14.1. Input Parameters ΓòÉΓòÉΓòÉ
  5990.  
  5991.  Parameter #1  Printer physical name (optional). 
  5992.  Parameter #2  XY-Query object for chart style settings (optional). 
  5993.  
  5994.  If Parameter #1 is not specified, the default printer as defined on the 
  5995.  requesting machine is used. If parameter #2 is not specified then a chart 
  5996.  conforming to the default specified in the Chart section of the Settings 
  5997.  Facility will be printed. 
  5998.  
  5999.  
  6000. ΓòÉΓòÉΓòÉ 13.14.14.2. Returns ΓòÉΓòÉΓòÉ
  6001.  
  6002.      REXX variable XYQRc 
  6003.            Value             Description 
  6004.       0                      The print request has completed successfully 
  6005.       Invalid number of arguments An incorrect number of parameters have been 
  6006.                              specified 
  6007.       Invalid argument       At least one parameter is invalid 
  6008.       No data to print       There is no data currently held which can be 
  6009.                              printed 
  6010.       Print request failed   The print request has failed to complete 
  6011.                              successfully 
  6012.  
  6013.  
  6014. ΓòÉΓòÉΓòÉ 13.14.14.3. Example ΓòÉΓòÉΓòÉ
  6015.  
  6016. /* Print on the default printer using the default    */
  6017. /* chart style settings.                             */
  6018.  
  6019. call XYQPrintChart
  6020.  
  6021. /* Print on printer PRT1 using style settings        */
  6022. /* contained in a named object.                      */
  6023.  
  6024. call XYQPrintChart 'PRT1' ,,
  6025.                    'C:\XYQUERY\WORK\STAFFCHT'
  6026.  
  6027.  
  6028. ΓòÉΓòÉΓòÉ 13.14.15. XYQPrintViewer ΓòÉΓòÉΓòÉ
  6029.  
  6030. This function prints the data from the last query run, to a specified printer, 
  6031. with, optionally, presentation settings from a named XY-Query object. The 
  6032. Viewer can only be printed in its Report View in either mode. 
  6033.  
  6034.  
  6035. ΓòÉΓòÉΓòÉ 13.14.15.1. Input Parameters ΓòÉΓòÉΓòÉ
  6036.  
  6037.  Parameter #1  Printer physical name (optional). 
  6038.  Parameter #2  XY-Query object for presentation settings (optional). This can 
  6039.                also be specified as 'U' or 'B' to specify the print the Viewer 
  6040.                Update or Browse modes. 
  6041.  
  6042.  If Parameter #1 is not specified, the default printer as defined on the 
  6043.  requesting machine is used. If parameter #2 is not specified then a report 
  6044.  conforming to the defaults specified in the Viewer section of the Settings 
  6045.  Facility will be printed. 
  6046.  
  6047.  
  6048. ΓòÉΓòÉΓòÉ 13.14.15.2. Returns ΓòÉΓòÉΓòÉ
  6049.  
  6050.      REXX variable XYQRc 
  6051.            Value             Description 
  6052.       0                      The print request has completed successfully 
  6053.       Invalid number of arguments An incorrect number of parameters have been 
  6054.                              specified 
  6055.       Invalid argument       At least one parameter is invalid 
  6056.       No data to print       There is no data currently held which can be 
  6057.                              printed 
  6058.       Print request failed   The print request has failed to complete 
  6059.                              successfully 
  6060.  
  6061.  
  6062. ΓòÉΓòÉΓòÉ 13.14.15.3. Example ΓòÉΓòÉΓòÉ
  6063.  
  6064. /* Print on default printer using default Viewer     */
  6065. /* presentation settings.                            */
  6066.  
  6067. call XYQPrintViewer
  6068.  
  6069. /* Print on printer PRT1 using specific presentation */
  6070. /* settings contained in a named object.             */
  6071. call XYQPrintViewer 'PRT1' ,,
  6072.                     'C:\XYQUERY\WORK\STAFFVWR'
  6073.  
  6074. /* Print on printer PRT1 in browse mode.             */
  6075. call XYQPrintViewer 'PRT1' , 'B'
  6076.  
  6077.  
  6078. ΓòÉΓòÉΓòÉ 13.14.15.4. Note ΓòÉΓòÉΓòÉ
  6079.  
  6080. For Version 1.0 compatibility specifying 'T' as the second parameter will be 
  6081. treated the same as 'U' and specifying 'R' will be considered the same as 'B'. 
  6082.  
  6083.  
  6084. ΓòÉΓòÉΓòÉ 13.14.16. XYQRegisterFunctions ΓòÉΓòÉΓòÉ
  6085.  
  6086. This function registers all other XY-Query functions to REXX. This removes the 
  6087. need for you to register each individual function separately. This function 
  6088. must be called to enable the procedure to call any other. 
  6089.  
  6090.  
  6091. ΓòÉΓòÉΓòÉ 13.14.16.1. Input Parameters ΓòÉΓòÉΓòÉ
  6092.  
  6093. NONE. 
  6094.  
  6095.  
  6096. ΓòÉΓòÉΓòÉ 13.14.16.2. Returns ΓòÉΓòÉΓòÉ
  6097.  
  6098.      REXX variable XYQRc 
  6099.            Value         Description 
  6100.       0                  Functions registered successfully 
  6101.       Function registration failed The XY-Query functions have not registered 
  6102.                          to REXX correctly. 
  6103.  
  6104.  
  6105. ΓòÉΓòÉΓòÉ 13.14.16.3. Example ΓòÉΓòÉΓòÉ
  6106.  
  6107. call XYQRegisterFunctions
  6108.  
  6109.  
  6110. ΓòÉΓòÉΓòÉ 13.14.17. XYQRunChart ΓòÉΓòÉΓòÉ
  6111.  
  6112. This function works in the same way as XYQRunQuery except that it shows the 
  6113. Chart Window immediately the data is returned from the query.  It is equivalent 
  6114. to running XYQRunQuery followed by XYQShowChart. 
  6115.  
  6116.  
  6117. ΓòÉΓòÉΓòÉ 13.14.17.1. Input Parameters ΓòÉΓòÉΓòÉ
  6118.  
  6119.  Parameter #1  File containing the query to be run and the presentation styles 
  6120.                for the Chart window to be shown. 
  6121.  Others        Detail any variable values that are to be passed to the query 
  6122.                (optional). 
  6123.  
  6124.  REXX limits the number of parameters to a function to twenty. If you wish to 
  6125.  pass a number of variables to your query that would cause this limit to be 
  6126.  exceeded you can construct a REXX array containing the variable specifications 
  6127.  and pass this array as parameter 2. The array you construct will be called 
  6128.  XYQVarList. 
  6129.  
  6130.  The first (zero) element will contain the number of variables being passed in 
  6131.  the array. The subsequent elements will contain text assigning values into 
  6132.  host variable names in the same fashion as if they were entered as individual 
  6133.  parameters to the API call. 
  6134.  
  6135.  
  6136. ΓòÉΓòÉΓòÉ 13.14.17.2. Returns ΓòÉΓòÉΓòÉ
  6137.  
  6138.      REXX variable XYQRc 
  6139.            Value             Description 
  6140.       0                      Query run and chart displayed successfully 
  6141.       Invalid number of arguments An incorrect number of parameters have been 
  6142.                              specified 
  6143.       Invalid argument       At least one parameter is invalid 
  6144.       Query not found        The object specified in parameter #1 can not be 
  6145.                              found 
  6146.       Unable to run query    The query specified failed to execute. 
  6147.       Query run failed       The query specified failed to run successfully. 
  6148.                              The sqlcode gives an indication of the cause of 
  6149.                              the error. 
  6150.      REXX variable XYQRows 
  6151.  
  6152.       Set to the number of rows retrieved by the query. 
  6153.      REXX variable XYQCols 
  6154.  
  6155.       Set to the number of columns retrieved by the query. 
  6156.      REXX variable XYQSQLCode 
  6157.  
  6158.       Contains the SQLCODE resulting from the query run. 
  6159.      REXX variable XYQSqlMsg 
  6160.  
  6161.       Contains the textual description of an error sqlcode. 
  6162.  
  6163.  
  6164. ΓòÉΓòÉΓòÉ 13.14.17.3. Examples ΓòÉΓòÉΓòÉ
  6165.  
  6166. /* Run the query held in the named object and        */
  6167. /* automatically chart the output.                   */
  6168.  
  6169. call XYQRunChart 'C:\XYQUERY\WORK\STAFFQRY1'
  6170.  
  6171. /* Specify a value for one variable required by the  */
  6172. /* named query and a REXX variable for another.      */
  6173.  
  6174. rx_years=5
  6175. call XYQRunChart 'C:\XYQUERY\WORK\STAFFQRY2' ,,
  6176.                  'dept=10' ,,
  6177.                  'years='rx_years
  6178.  
  6179. /* Specify the variables in the array XYQVarList     */
  6180. /* and pass as Parameter #2.                         */
  6181.  
  6182. XYQVarList.0=5
  6183. XYQVarList.1='upper_comm=3000'
  6184. XYQVarList.2='lower_comm=1000'
  6185. XYQVarList.3='upper_salary=9000'
  6186. XYQVarList.4='lower_salary=4000'
  6187. XYQVarList.5='dept=10'
  6188.  
  6189. call XYQRunChart 'C:\XYQUERY\WORK\STAFFQRY3' ,,
  6190.                  XYQVarList
  6191.  
  6192.  
  6193. ΓòÉΓòÉΓòÉ 13.14.17.4. Notes ΓòÉΓòÉΓòÉ
  6194.  
  6195. If the query to be run contains substitution variables that are not passed as 
  6196. parameters to the function, you are asked to enter the values in the normal 
  6197. XY-Query fashion. 
  6198.  
  6199. You cannot use both methods of specifying variables in the same call. If 
  6200. parameter 2 is set to XYQVarList then any subsequent parameters are ignored. 
  6201.  
  6202.  
  6203. ΓòÉΓòÉΓòÉ 13.14.18. XYQRunQuery ΓòÉΓòÉΓòÉ
  6204.  
  6205. This function loads and runs a named query. Specify a fully-qualified file path 
  6206. if the query is not in the directory identified by the XYQWORK environment 
  6207. variable. If the query requires run time variables, you can pass values into 
  6208. them. The query must already exist having been previously saved as an XY-Query 
  6209. Query, Viewer or Chart object. 
  6210.  
  6211.  
  6212. ΓòÉΓòÉΓòÉ 13.14.18.1. Input Parameters ΓòÉΓòÉΓòÉ
  6213.  
  6214.  Parameter #1  File containing the query to be run 
  6215.  Others        Detail any variable values that are to be passed to the query 
  6216.                (optional). 
  6217.  
  6218.  REXX limits the number of parameters to a function to twenty. If you wish to 
  6219.  pass a number of variables to your query that would cause this limit to be 
  6220.  exceeded you can construct a REXX array containing the variable specifications 
  6221.  and pass this array as parameter 2. The array you construct will be called 
  6222.  XYQVarList. 
  6223.  
  6224.  The first (zero) element will contain the number of variables being passed in 
  6225.  the array. The subsequent elements will contain text assigning values into 
  6226.  host variable names in the same fashion as if they were entered as individual 
  6227.  parameters to the API call. 
  6228.  
  6229.  
  6230. ΓòÉΓòÉΓòÉ 13.14.18.2. Returns ΓòÉΓòÉΓòÉ
  6231.  
  6232.      REXX variable XYQRc 
  6233.            Value             Description 
  6234.       0                      Query run successfully 
  6235.       Invalid number of arguments An incorrect number of parameters have been 
  6236.                              specified 
  6237.       Invalid argument       At least one parameter is invalid 
  6238.       Query not found        The object specified in parameter #1 can not be 
  6239.                              found 
  6240.       Unable to run query    The query specified failed to execute. 
  6241.       Query run failed       The query specified failed to run successfully. 
  6242.                              The sqlcode gives an indication of the cause of 
  6243.                              the error. 
  6244.      REXX variable XYQRows 
  6245.  
  6246.       Set to the number of rows retrieved by the query. 
  6247.      REXX variable XYQCols 
  6248.  
  6249.       Set to the number of columns retrieved by the query. 
  6250.      REXX variable XYQSQLCode 
  6251.  
  6252.       Contains the SQLCODE resulting from the query run. 
  6253.      REXX variable XYQSqlMsg 
  6254.  
  6255.       Contains the textual description of an error sqlcode. 
  6256.  
  6257.  
  6258. ΓòÉΓòÉΓòÉ 13.14.18.3. Examples ΓòÉΓòÉΓòÉ
  6259.  
  6260. /* Run the query held in the named object            */
  6261.  
  6262. call XYQRunQuery 'C:\XYQUERY\WORK\STAFFQRY1'
  6263.  
  6264. /* Specify a value for one variable required by the  */
  6265. /* named query and a REXX variable for another.      */
  6266.  
  6267. rx_years=5
  6268. call XYQRunQuery 'C:\XYQUERY\WORK\STAFFQRY2' ,,
  6269.                  'id=10' ,,
  6270.                  'years='rx_years
  6271.  
  6272. /* Specify the variables in the array XYQVarList     */
  6273. /* and pass as Parameter #2.                         */
  6274.  
  6275. XYQVarList.0=5
  6276. XYQVarList.1='upper_comm=3000'
  6277. XYQVarList.2='lower_comm=1000'
  6278. XYQVarList.3='upper_salary=9000'
  6279. XYQVarList.4='lower_salary=4000'
  6280. XYQVarList.5='dept=10'
  6281.  
  6282. call XYQRunQuery 'C:\XYQUERY\WORK\STAFFQRY3' ,,
  6283.                  XYQVarList
  6284.  
  6285.  
  6286. ΓòÉΓòÉΓòÉ 13.14.18.4. Notes ΓòÉΓòÉΓòÉ
  6287.  
  6288. If the query to be run contains substitution variables that are not passed as 
  6289. parameters to the function, you are asked to enter the values in the normal 
  6290. XY-Query fashion. 
  6291.  
  6292. You cannot use both methods of specifying variables in the same call. If 
  6293. parameter 2 is set to XYQVarList then any subsequent parameters are ignored. 
  6294.  
  6295.  
  6296. ΓòÉΓòÉΓòÉ 13.14.19. XYQRunSQL ΓòÉΓòÉΓòÉ
  6297.  
  6298. This function runs a query passed as a parameter against a named location. 
  6299.  
  6300.  
  6301. ΓòÉΓòÉΓòÉ 13.14.19.1. Input Parameters ΓòÉΓòÉΓòÉ
  6302.  
  6303.  Parameter #1  Name of the location against which to run the query 
  6304.  Parameter #2  Text of the query to run 
  6305.  Others        Detail any variable values that are to be passed to the query 
  6306.                (optional). 
  6307.  
  6308.  REXX limits the number of parameters to a function to twenty. If you wish to 
  6309.  pass a number of variables to your query that would cause this limit to be 
  6310.  exceeded you can construct a REXX array containing the variable specifications 
  6311.  and pass this array as parameter 3. The array you construct will be called 
  6312.  XYQVarList. 
  6313.  
  6314.  The first (zero) element will contain the number of variables being passed in 
  6315.  the array. The subsequent elements will contain text assigning values into 
  6316.  host variable names in the same fashion as if they were entered as individual 
  6317.  parameters to the API call. 
  6318.  
  6319.  
  6320. ΓòÉΓòÉΓòÉ 13.14.19.2. Returns ΓòÉΓòÉΓòÉ
  6321.  
  6322.      REXX variable XYQRc 
  6323.            Value             Description 
  6324.       0                      Query run successfully 
  6325.       Invalid number of arguments An incorrect number of parameters have been 
  6326.                              specified 
  6327.       Invalid argument       At least one parameter is invalid 
  6328.       Unable to run query    The query specified failed to start to execute. 
  6329.       Query run failed       The query specified failed to run successfully. 
  6330.                              The sqlcode gives an indication of the cause of 
  6331.                              the error. 
  6332.      REXX variable XYQRows 
  6333.  
  6334.       Set to the number of rows retrieved by the query. 
  6335.      REXX variable XYQCols 
  6336.  
  6337.       Set to the number of columns retrieved by the query. 
  6338.      REXX variable XYQSQLCode 
  6339.  
  6340.       Contains the SQLCODE resulting from the query run. 
  6341.      REXX variable XYQSqlMsg 
  6342.  
  6343.       Contains the textual description of an error sqlcode. 
  6344.  
  6345.  
  6346. ΓòÉΓòÉΓòÉ 13.14.19.3. Examples ΓòÉΓòÉΓòÉ
  6347.  
  6348. /* Run a specific query against a named database     */
  6349.  
  6350. call XYQRunSQL 'SAMPLE' ,,
  6351.                'SELECT ID , JOB FROM USERID.STAFF'
  6352.  
  6353. /* Pass a REXX variable as a value for a             */
  6354. /* substitution variable required by the query.      */
  6355.  
  6356. rx_years=5
  6357. call XYQRunSQL 'SAMPLE' ,
  6358.                'SELECT ID , JOB FROM USERID.STAFF ' ,
  6359.                'WHERE YEARS > &yrs' ,,
  6360.                'yrs='rx_years
  6361.  
  6362. /* Specify the variables in the array XYQVarList     */
  6363. /* and pass as Parameter #3.                         */
  6364.  
  6365. XYQVarList.0=3
  6366. XYQVarList.1='upper_salary=9000'
  6367. XYQVarList.2='lower_salary=4000'
  6368. XYQVarList.3='dept=10'
  6369.  
  6370. call XYQRunSQL 'SAMPLE' ,
  6371.                'SELECT ID , JOB FROM USERID.STAFF ' ,
  6372.                'WHERE DEPT = &dept AND SALARY BETWEEN' ,,
  6373.                '&lower_salary AND &upper_salary' ,,
  6374.                XYQVarList
  6375.  
  6376.  
  6377. ΓòÉΓòÉΓòÉ 13.14.19.4. Notes ΓòÉΓòÉΓòÉ
  6378.  
  6379. If the query to be run contains substitution variables that are not passed as 
  6380. parameters to the function, you are asked to enter the values in the normal 
  6381. XY-Query fashion. 
  6382.  
  6383. You cannot use both methods of specifying variables in the same call. If 
  6384. parameter 3 is set to XYQVarList then any subsequent parameters are ignored. 
  6385.  
  6386.  
  6387. ΓòÉΓòÉΓòÉ 13.14.20. XYQRunViewer ΓòÉΓòÉΓòÉ
  6388.  
  6389. This function works in the same way as XYQRunQuery except that it shows the 
  6390. Viewer immediately the data is returned from the query.  It is equivalent to 
  6391. running XYQRunQuery followed by XYQShowViewer. 
  6392.  
  6393.  
  6394. ΓòÉΓòÉΓòÉ 13.14.20.1. Input Parameters ΓòÉΓòÉΓòÉ
  6395.  
  6396.  Parameter #1  File containing the query to be run and the presentation styles 
  6397.                for the Viewer window to be shown. 
  6398.  Others        Detail any variable values that are to be passed to the query 
  6399.                (optional). 
  6400.  
  6401.  REXX limits the number of parameters to a function to twenty. If you wish to 
  6402.  pass a number of variables to your query that would cause this limit to be 
  6403.  exceeded you can construct a REXX array containing the variable specifications 
  6404.  and pass this array as parameter 2. The array you construct will be called 
  6405.  XYQVarList. 
  6406.  
  6407.  The first (zero) element will contain the number of variables being passed in 
  6408.  the array. The subsequent elements will contain text assigning values into 
  6409.  host variable names in the same fashion as if they were entered as individual 
  6410.  parameters to the API call. 
  6411.  
  6412.  
  6413. ΓòÉΓòÉΓòÉ 13.14.20.2. Returns ΓòÉΓòÉΓòÉ
  6414.  
  6415.      REXX variable XYQRc 
  6416.            Value             Description 
  6417.       0                      Query run and Viewer displayed successfully 
  6418.       Invalid number of arguments An incorrect number of parameters have been 
  6419.                              specified 
  6420.       Invalid argument       At least one parameter is invalid 
  6421.       Query not found        The object specified in parameter #1 can not be 
  6422.                              found 
  6423.       Unable to run query    The query specified failed to execute. 
  6424.       Query run failed       The query specified failed to run successfully. 
  6425.                              The sqlcode gives an indication of the cause of 
  6426.                              the error. 
  6427.      REXX variable XYQRows 
  6428.  
  6429.       Set to the number of rows retrieved by the query. 
  6430.      REXX variable XYQCols 
  6431.  
  6432.       Set to the number of columns retrieved by the query. 
  6433.      REXX variable XYQSQLCode 
  6434.  
  6435.       Contains the SQLCODE resulting from the query run. 
  6436.      REXX variable XYQSqlMsg 
  6437.  
  6438.       Contains the textual description of an error sqlcode. 
  6439.  
  6440.  
  6441. ΓòÉΓòÉΓòÉ 13.14.20.3. Examples ΓòÉΓòÉΓòÉ
  6442.  
  6443. /* Run the query held in the named object and        */
  6444. /* automatically display the data in the Viewer      */
  6445.  
  6446. call XYQRunViewer 'C:\XYQUERY\WORK\STAFFQRY1'
  6447.  
  6448. /* Specify a value for one variable required by the  */
  6449. /* named query and a REXX variable for another.      */
  6450.  
  6451. rx_years=5
  6452. call XYQRunViewer 'C:\XYQUERY\WORK\STAFFQRY2' ,,
  6453.                   'id=10' ,,
  6454.                   'years='rx_years
  6455.  
  6456. /* Specify the variables in the array XYQVarList     */
  6457. /* and pass as Parameter #2.                         */
  6458.  
  6459. XYQVarList.0=5
  6460. XYQVarList.1='upper_comm=3000'
  6461. XYQVarList.2='lower_comm=1000'
  6462. XYQVarList.3='upper_salary=9000'
  6463. XYQVarList.4='lower_salary=4000'
  6464. XYQVarList.5='dept=10'
  6465.  
  6466. call XYQRunViewer 'C:\XYQUERY\WORK\STAFFQRY3' ,,
  6467.                    XYQVarList
  6468.  
  6469.  
  6470. ΓòÉΓòÉΓòÉ 13.14.20.4. Notes ΓòÉΓòÉΓòÉ
  6471.  
  6472. If the query to be run contains substitution variables that are not passed as 
  6473. parameters to the function, you are asked to enter the values in the normal 
  6474. XY-Query fashion. 
  6475.  
  6476. You cannot use both methods of specifying variables in the same call. If 
  6477. parameter 3 is set to XYQVarList then any subsequent parameters are ignored. 
  6478.  
  6479.  
  6480. ΓòÉΓòÉΓòÉ 13.14.21. XYQShowChart ΓòÉΓòÉΓòÉ
  6481.  
  6482. This function displays the chart showing the data returned from the last query 
  6483. run. If no parameter is passed indicating from which XY-Query object the Chart 
  6484. presentation attributes should be retrieved, then the chart will be shown using 
  6485. the defaults as specified in the Chart section of the Settings Facility. 
  6486.  
  6487.  
  6488. ΓòÉΓòÉΓòÉ 13.14.21.1. Input Parameters ΓòÉΓòÉΓòÉ
  6489.  
  6490.  Parameter #1  XY-Query object from which to get Chart Window presentation 
  6491.                settings (optional). 
  6492.  
  6493.  
  6494. ΓòÉΓòÉΓòÉ 13.14.21.2. Returns ΓòÉΓòÉΓòÉ
  6495.  
  6496.      REXX variable XYQRc 
  6497.            Value             Description 
  6498.       0                      Chart displayed successfully 
  6499.       Invalid number of arguments An incorrect number of parameters have been 
  6500.                              specified 
  6501.       Invalid argument       At least one parameter is invalid 
  6502.       No data to show        There is no data currently held which can be 
  6503.                              plotted. 
  6504.  
  6505.  
  6506. ΓòÉΓòÉΓòÉ 13.14.21.3. Example ΓòÉΓòÉΓòÉ
  6507.  
  6508. /* Show a chart using default display attributes.    */
  6509.  
  6510. call XYQShowChart
  6511.  
  6512. /* Show a chart using attributes from named object.  */
  6513.  
  6514. call XYQShowChart 'C:\XYQUERY\WORK\STAFFQRY'
  6515.  
  6516.  
  6517. ΓòÉΓòÉΓòÉ 13.14.22. XYQShowViewer ΓòÉΓòÉΓòÉ
  6518.  
  6519. This function displays the Viewer to show the data returned from the last query 
  6520. run. If no parameter is passed indicating from which XY-Query object the Viewer 
  6521. presentation attributes should be retrieved, then it will be shown using the 
  6522. defaults as specified in the Viewer section of the Settings Facility. 
  6523.  
  6524.  
  6525. ΓòÉΓòÉΓòÉ 13.14.22.1. Input Parameters ΓòÉΓòÉΓòÉ
  6526.  
  6527.  Parameter #1  XY-Query object from which to get Viewer presentation settings 
  6528.                (optional). 
  6529.  
  6530.  
  6531. ΓòÉΓòÉΓòÉ 13.14.22.2. Returns ΓòÉΓòÉΓòÉ
  6532.  
  6533.      REXX variable XYQRc 
  6534.            Value             Description 
  6535.       0                      Viewer displayed successfully 
  6536.       Invalid number of arguments An incorrect number of parameters have been 
  6537.                              specified 
  6538.       Invalid argument       At least one parameter is invalid 
  6539.       No data to show        There is no data currently held which can be 
  6540.                              displayed. 
  6541.  
  6542.  
  6543. ΓòÉΓòÉΓòÉ 13.14.22.3. Example ΓòÉΓòÉΓòÉ
  6544.  
  6545. /* Show the Viewer using default attributes          */
  6546.  
  6547. call XYQShowViewer
  6548.  
  6549. /* Show Viewer using attributes from named object    */
  6550.  
  6551. call XYQShowViewer 'C:\XYQUERY\WORK\STAFFQRY'
  6552.  
  6553.  
  6554. ΓòÉΓòÉΓòÉ 13.14.23. XYQTerminate ΓòÉΓòÉΓòÉ
  6555.  
  6556. This function terminates and tidies up an XY-Query session.  This function is 
  6557. not necessary in procedures run in the Procedure Window although it has no 
  6558. adverse effects if it is called. In command files and other REXX programs 
  6559. however, this function MUST always be called after the last XY-Query function 
  6560. is processed and before the functions are de-registered. 
  6561.  
  6562.  
  6563. ΓòÉΓòÉΓòÉ 13.14.23.1. Input Parameters ΓòÉΓòÉΓòÉ
  6564.  
  6565. NONE. 
  6566.  
  6567.  
  6568. ΓòÉΓòÉΓòÉ 13.14.23.2. Returns ΓòÉΓòÉΓòÉ
  6569.  
  6570.      REXX variable XYQRc 
  6571.            Value         Description 
  6572.       0                  Termination completed successfully 
  6573.  
  6574.  
  6575. ΓòÉΓòÉΓòÉ 13.14.23.3. Example ΓòÉΓòÉΓòÉ
  6576.  
  6577. /* Call clean up routine. For use in command files   */
  6578. /* and other REXX programs. Use after last function  */
  6579. /* call has been made and before de-registering      */
  6580.  
  6581. call XYQTerminate
  6582.  
  6583.  
  6584. ΓòÉΓòÉΓòÉ 13.14.24. XYQTopOfData ΓòÉΓòÉΓòÉ
  6585.  
  6586. This function resets the data-fetching process such that when either 
  6587. XYQGetDataItem or XYQGetDataRow is next called, it starts at the top of the 
  6588. data. 
  6589.  
  6590.  
  6591. ΓòÉΓòÉΓòÉ 13.14.24.1. Input Parameters ΓòÉΓòÉΓòÉ
  6592.  
  6593. NONE. 
  6594.  
  6595.  
  6596. ΓòÉΓòÉΓòÉ 13.14.24.2. Returns ΓòÉΓòÉΓòÉ
  6597.  
  6598.      REXX variable XYQRc 
  6599.            Value         Description 
  6600.       0                  Fetch pointer reset to the top of the data 
  6601.                          successfully 
  6602.       No data to show    The reset could not be done as there is no data 
  6603.                          currently held. 
  6604.  
  6605.  
  6606. ΓòÉΓòÉΓòÉ 13.14.24.3. Example ΓòÉΓòÉΓòÉ
  6607.  
  6608. /* Re-position the data fetching pointer to the      */
  6609. /* first element of data again.                      */
  6610.  
  6611. call XYQTopOfData
  6612.  
  6613.  
  6614. ΓòÉΓòÉΓòÉ 13.15. REXX variables used by XY-Query ΓòÉΓòÉΓòÉ
  6615.  
  6616. The following REXX variables are set and used by XY-Query procedures: 
  6617.  
  6618.  XYQRc          This is set when each XY-Query function completes. If the 
  6619.                 function has completed successfully it contains zero, otherwise 
  6620.                 it contains a textual description of the error. Check this in 
  6621.                 the REXX program after each XY-Query call. 
  6622.  
  6623.  XYQSqlCode     This is set whenever an XY-Query function that runs a query is 
  6624.                 called. It contains the SQLCODE resulting from the query 
  6625.                 execution. Check this after every XY-Query query function 
  6626.                 request. 
  6627.  
  6628.  XYQSqlMsg      This is set in conjunction with XYQSqlCode. It contains the 
  6629.                 textual description of an error sqlcode. If a query completes 
  6630.                 successfully (sqlcode = 0) then XYQSqlMsg will be empty. It is 
  6631.                 used by the functions that run queries and those that create 
  6632.                 and erase tables. 
  6633.  
  6634.  XYQRows        This is set to the number of rows retrieved by a query. If a 
  6635.                 query fails it is set to zero. 
  6636.  
  6637.  XYQCols        This is set to the number of columns retrieved by a query. If a 
  6638.                 query fails it is set to zero. 
  6639.  
  6640.  XYQAttributes  This is the default array name for the XYQGetAllAttributes 
  6641.                 function. It is be two dimensional and contain the type, size 
  6642.                 and null details for each column retrieved by the last query 
  6643.                 run. The XYQAttributes.0.0 element contains the number of 
  6644.                 columns for which details are included. The column type 
  6645.                 information is stored in elements XYQAttributes.x.0, where x is 
  6646.                 between 1 and the number of columns. The column size 
  6647.                 information is stored in elements XYQAttributes.x.1 and the 
  6648.                 nulls information is stored in elements XYQAttributes.x.2. 
  6649.  
  6650.  XYQColNames    This is the default array name for the XYQGetAllColNames 
  6651.                 function. It contains the real column names as defined in the 
  6652.                 database, for the last query run. The zero element contains the 
  6653.                 number of names included. The names themselves start at element 
  6654.                 1. 
  6655.  
  6656.  XYQHeadings    This is the default array name for the XYQGetAllHeadings 
  6657.                 function. It contains the column titles, including those that 
  6658.                 have been user-defined, for the last query run. The zero 
  6659.                 element contains the number of headings included. The headings 
  6660.                 themselves start at element 1. 
  6661.  
  6662.  XYQColHead     This variable is used to hold a single column title. It 
  6663.                 contains user-defined column titles where they have been set. 
  6664.                 The variable is set when the XYQGetColHead function is 
  6665.                 requested. 
  6666.  
  6667.  XYQColName     This variable is used to hold a single column name. It contains 
  6668.                 column names as defined in the database, ignoring any 
  6669.                 user-defined overrides. The variable is set when the 
  6670.                 XYQGetColName function is requested. 
  6671.  
  6672.  XYQDataRow     This is the default array name for the XYQGetDataRow function. 
  6673.                 It contains a whole row of data from the last query run in its 
  6674.                 elements. The zero element contains the number of data items 
  6675.                 retrieved. The data items themselves start at element 1. 
  6676.  
  6677.  XYQDataItem    This variable is used to hold a single item of data when the 
  6678.                 XYQGetDataItem function is called. 
  6679.  
  6680.  XYQConfirm     Set this variable from within the REXX program. It is 
  6681.                 interrogated by XY-Query. If it is set to NO, XY-Query does not 
  6682.                 ask for confirmation of updates resulting from INSERT, UPDATE 
  6683.                 or DELETE queries before they are made. Also, the confirmation, 
  6684.                 or not, of a request to delete a table (XYQEraseTable) depends 
  6685.                 on the state of this variable.  If this variable is not set, 
  6686.                 XY-Query assumes confirmation is required. 
  6687.  
  6688.  XYQFormat      Set this variable from within the REXX program.  It is 
  6689.                 interrogated by XY-Query. If it is set to NO, XY-Query does not 
  6690.                 attempt to format the data returned from the XYQGetDataItem and 
  6691.                 XYQGetDataRow function calls. If it is set to YES, data 
  6692.                 returned by these function calls is subject to formatting as 
  6693.                 defined in the Language and Date/Time pages in the General 
  6694.                 section of the XY-Query settings facility or overridden with 
  6695.                 settings from the Country and Date/Time pages in the Viewer 
  6696.                 settings for an individual object. This formatting includes the 
  6697.                 insertion of thousands separators into numeric data and the 
  6698.                 truncation of decimal data after a number of decimal places. 
  6699.  
  6700.                 The default value for this variable is NO which means no 
  6701.                 formatting is done. 
  6702.  
  6703.  XYQVarList     This is the REXX array name that you can use to pass run time 
  6704.                 variables to queries run from the XYQRunSql, XYQRunQuery, 
  6705.                 XYQRunViewer and XYQRunChart functions. This is particularly 
  6706.                 useful when you have a large number of run time variables that, 
  6707.                 when specified individually, would cause the function to exceed 
  6708.                 twenty parameters which is the REXX maximum. 
  6709.  
  6710.  
  6711. ΓòÉΓòÉΓòÉ 14. Using the XY-Query settings facility ΓòÉΓòÉΓòÉ
  6712.  
  6713.  
  6714. ΓòÉΓòÉΓòÉ 14.1. Introduction ΓòÉΓòÉΓòÉ
  6715.  
  6716. This chapter describes the use of the XY-Query Settings facility.  This allows 
  6717. you to change the defaults and current attributes used by XY-Query. It allows 
  6718. you to tailor your XY-Query installation to your own personal preferences. The 
  6719. XY-Query Settings facility consists of five sections. If the Settings object in 
  6720. the XY-Query folder on the desktop is opened a further folder will appear that 
  6721. contains five objects relating to the sections of the Settings facility. 
  6722.  
  6723. XY-Query Settings folder 
  6724.  
  6725. The sections in the Settings facility are as follows. 
  6726.  
  6727.      General settings 
  6728.      SQL settings 
  6729.      Viewer settings 
  6730.      Chart settings 
  6731.      Procedure settings 
  6732.  
  6733.  When any of the individual settings objects are opened a notebook is displayed 
  6734.  from where you can update the defaults for the specific area of the XY-Query 
  6735.  installation. 
  6736.  
  6737.  For all pages in each notebook complete the fields as explained in the 
  6738.  appropriate sections of this chapter. Press Apply to apply the changes, 
  6739.  Default to use the default XY-Query values, or Undo to cancel the changes and 
  6740.  return to the previously applied settings. 
  6741.  
  6742.  When you have finished tailoring defaults, close the relevant Settings 
  6743.  notebook.  Many settings have an immediate effect on any currently open 
  6744.  XY-Query objects but others provide the defaults whenever a new object is 
  6745.  created. 
  6746.  
  6747.  
  6748. ΓòÉΓòÉΓòÉ 14.2. General settings ΓòÉΓòÉΓòÉ
  6749.  
  6750. You use the General Settings notebook to tailor attributes that are relevant 
  6751. across the whole application. 
  6752.  
  6753. You can tailor these attributes: 
  6754.  
  6755.      General Settings - Language page 
  6756.      General Settings - Date / Time page 
  6757.      General Settings - Timings page 
  6758.      General Settings - Variables page 
  6759.      General Settings - Window page 
  6760.      General Settings - Limits page 
  6761.  
  6762.  
  6763. ΓòÉΓòÉΓòÉ 14.2.1. General Settings - Language page ΓòÉΓòÉΓòÉ
  6764.  
  6765. XY-Query General Settings - Language page 
  6766.  
  6767.       Language 
  6768.  
  6769.       Use the pulldown to select a language to be used by XY-Query for messages 
  6770.       and prompts.  The choice depends on the languages available in the 
  6771.       version of XY-Query you have installed. 
  6772.       Currency 
  6773.  
  6774.       Enter a symbol to be used as the default for for showing currency data in 
  6775.       XY-Query reports. Click on the Prefix or Suffix radio button to choose 
  6776.       whether this symbol is to be used by default as a prefix or suffix. 
  6777.       1000's separator 
  6778.  
  6779.       Use the pulldown to select the default separator for thousands Select 
  6780.       either a comma to display the number one thousand as 1,000, or a period 
  6781.       to display the number one thousand as 1.000. 
  6782.       Decimal separator 
  6783.  
  6784.       Use the pulldown to select the default separator for decimal values (use 
  6785.       a period  to show one and a half as 1.5, or a comma for 1,5). 
  6786.       Decimal Places 
  6787.  
  6788.       Use this field to specify the default maximum number of digits to display 
  6789.       after the separator for decimal values. 
  6790.       Override database settings 
  6791.  
  6792.       Use this field to decide whether to show the data returned from a query 
  6793.       in its raw form, or tailored according to the settings on this page. 
  6794.  
  6795.  
  6796. ΓòÉΓòÉΓòÉ 14.2.2. General Settings - Date / Time page ΓòÉΓòÉΓòÉ
  6797.  
  6798. XY-Query General Settings - Date/Time page 
  6799.  
  6800.       Date format - format 
  6801.  
  6802.       Use the pulldown to choose an order to be used for dates in XY-Query 
  6803.       messages, reports and charts (Day Month Year, Month Day Year or Year 
  6804.       Month Day). 
  6805.       Date separator 
  6806.  
  6807.       Use the field and spin button to choose a date separator, for example, a 
  6808.       hyphen if you want dates to appear like 17-06-95. 
  6809.       Time format - format 
  6810.  
  6811.       Use the pulldown to choose a format for showing times in XY-Query 
  6812.       messages, reports and charts. For example, 12 or 24 hour clock. 
  6813.       Time separator 
  6814.  
  6815.       Use the field and spin button to choose a time separator, for example, a 
  6816.       colon if you want times to appear like 07:30. 
  6817.       Override database settings 
  6818.  
  6819.       Use this field to decide whether to show the data returned from a query 
  6820.       in its raw form, or tailored according to the settings on this page. 
  6821.  
  6822.  
  6823. ΓòÉΓòÉΓòÉ 14.2.3. General Settings - Timings page ΓòÉΓòÉΓòÉ
  6824.  
  6825. XY-Query General Settings - Timings page 
  6826.  
  6827.       Chart / Viewer Refresh Interval 
  6828.  
  6829.       Use the spin buttons to choose the interval used for auto-refreshing the 
  6830.       Chart and Viewer windows. This interval is used when Auto-Refresh is 
  6831.       turned on in either of these windows. It is only necessary to select 
  6832.       auto-refresh from one of the Viewer or Chart windows. If both are showing 
  6833.       they are refreshed simultaneously. 
  6834.       System Library Retain Interval 
  6835.  
  6836.       When XY-Query is started, there may be a delay while the System Library 
  6837.       is loaded. If you use XY-Query regularly, you can retain the System 
  6838.       Library in memory to avoid this delay.  Use these controls to choose 
  6839.       whether or not the System Library is retained in memory and the interval 
  6840.       for which it is retained. 
  6841.  
  6842.       You choose one of these options: tize=12. 
  6843.       Indefinite     Select the Indefinite radio button to retain the System 
  6844.                      Library in memory until the computer is switched off or 
  6845.                      re-booted. 
  6846.       None           Select the None radio button if you do not want the System 
  6847.                      Library to be retained.  It will be reloaded the next time 
  6848.                      you open an XY-Query object. 
  6849.       Timed          Select the Timed radio button to retain the System Library 
  6850.                      for a fixed interval which you define using the Minutes 
  6851.                      spin button. The 'countdown' to the release of the System 
  6852.                      Library starts as soon as the last instance of XY-Query is 
  6853.                      closed. Starting another XY-Query session before the 
  6854.                      System Library has been released stops this 'countdown' 
  6855.  
  6856.  
  6857. ΓòÉΓòÉΓòÉ 14.2.4. General Settings - Variables page ΓòÉΓòÉΓòÉ
  6858.  
  6859. XY-Query General Settings - Variables page 
  6860.  
  6861. Use the Variables Page to review and, if required, delete variables previously 
  6862. used in queries and held by XY-Query. 
  6863.  
  6864. To delete unwanted variables, select the variable or variables from the list, 
  6865. then press Erase to erase them from the list.  You can use the check boxes to 
  6866. select or de-select all variables in the list.  The variables are not deleted 
  6867. from XY-Query until you press the Apply button. 
  6868.  
  6869.  
  6870. ΓòÉΓòÉΓòÉ 14.2.5. General Settings - Window page ΓòÉΓòÉΓòÉ
  6871.  
  6872. XY-Query General Settings - Window page 
  6873.  
  6874. Use the Window page to set the Save option for all instances of XY-Query and to 
  6875. also set the defaults for the appearance, or not, of certain features on 
  6876. XY-Query windows for all new objects created. 
  6877.  
  6878. For the Save option there are three potential choices. If you select Save On 
  6879. Close then all attributes of the XY-Query windows are saved automatically when 
  6880. the primary window of the object is closed. If you select Prompt On Close then 
  6881. XY-Query prompts for a save decision when the object is closed and it detects 
  6882. that the object attributes have changed since it was opened or it was last 
  6883. explicitly saved. If neither is selected then the XY-Query instance does not 
  6884. perform any save activity when the object closes. In this case the only way to 
  6885. cause the object to be saved with its latest attributes would be to request an 
  6886. explicit Save from one of the object windows. 
  6887.  
  6888. The XY-Query features that can be defaulted from this page are the appearance, 
  6889. or not, by default of Tool and Information bars on any new XY-Query objects, 
  6890. and the availability of the toolbar tips facility. If this latter feature is 
  6891. enabled then any current XY-Query instances pick it up and causes descriptions 
  6892. to be displayed about the function of buttons on the toolbar as the mouse 
  6893. passes over them. 
  6894.  
  6895.  
  6896. ΓòÉΓòÉΓòÉ 14.2.6. General Settings - Limits page ΓòÉΓòÉΓòÉ
  6897.  
  6898. XY-Query General Settings - Limits page 
  6899.  
  6900. Use the Limits Page to set certain limiting defaults for new XY-Query objects. 
  6901. Complete the page as shown below: 
  6902.  
  6903.       Character limit 
  6904.  
  6905.       Use this field to specify the maximum number of characters to display in 
  6906.       the Viewer when columns of all character types are returned from a query. 
  6907.       Fetch Limit 
  6908.  
  6909.       Use this field to specify the default value for the maximum number of 
  6910.       rows which will be fetched by a query for any new XY-Query object. 
  6911.       Maximum Fetch Limit 
  6912.  
  6913.       Use this field to specify the maximum value to which the default Fetch 
  6914.       Limit can be set. It also set the upper bound to which an individual 
  6915.       XY-Query object can set its own Fetch Limit. 
  6916.       Low Memory Limit 
  6917.  
  6918.       Use this field to specify the minimum amount of memory, in megabytes, 
  6919.       that the computer must have available for XY-Query to continue. If 
  6920.       XY-Query detects that the limit has been breached, it terminates all 
  6921.       running queries immediately. 
  6922.  
  6923.  Note: 
  6924.  
  6925.    1. The check on the amount of memory available is made automatically by 
  6926.       XY-Query every second. The value specified in the Low Memory Limit 
  6927.       setting should take into account the power and speed of the processor 
  6928.       with respect to the amount of data it can return in one second. The 
  6929.       faster and more powerful the processor then the larger this value may 
  6930.       need to be. 
  6931.    2. The purpose of having this setting is to provide protection from the 
  6932.       undefined behaviour of the operating system in extreme low memory 
  6933.       situations. 
  6934.  
  6935.  
  6936. ΓòÉΓòÉΓòÉ 14.3. SQL settings ΓòÉΓòÉΓòÉ
  6937.  
  6938. You use the SQL Settings notebook to tailor attributes that are relevant 
  6939. primarily for the SQL window. See the following sections to find out how to 
  6940. tailor these attributes: 
  6941.  
  6942.      SQL Settings - Presentation page 
  6943.      SQL Settings - View page 
  6944.      SQL Settings - History page 
  6945.      SQL Settings - Defaults page 
  6946.      SQL Settings - Table Names page 
  6947.      SQL Settings - Wildcards page 
  6948.  
  6949.  
  6950. ΓòÉΓòÉΓòÉ 14.3.1. SQL Settings - Presentation page ΓòÉΓòÉΓòÉ
  6951.  
  6952. Use the SQL Presentation Page to choose the background colours, text colours 
  6953. and the font for the SQL editor to be used by default in any new XY-Query 
  6954. objects that can show the SQL window. 
  6955.  
  6956.  
  6957. ΓòÉΓòÉΓòÉ 14.3.2. SQL Settings - View page ΓòÉΓòÉΓòÉ
  6958.  
  6959. SQL Settings - View page 
  6960.  
  6961. Use the SQL View Page to determine the default view in which the SQL window 
  6962. appears when a new XY-Query object is created. 
  6963.  
  6964. Make the selection from either of these views: 
  6965.  
  6966.      Builder view 
  6967.      Edit SQL view 
  6968.  
  6969.  
  6970. ΓòÉΓòÉΓòÉ 14.3.3. SQL Settings - History page ΓòÉΓòÉΓòÉ
  6971.  
  6972. Use the SQL History Page to determine the default method in which the History 
  6973. Ring operates in new XY-Query objects. 
  6974.  
  6975. If you want to save the History Ring with an object, select the History Save 
  6976. option. If you choose this then you can specify the maximum number of queries 
  6977. that can be saved as the History Ring for the object. 
  6978.  
  6979. If you want XY-Query to add queries automatically into the History Ring when a 
  6980. query has executed successfully, select the Add to History On Run option. 
  6981. Otherwise items can only be added to the History Ring manually. 
  6982.  
  6983.  
  6984. ΓòÉΓòÉΓòÉ 14.3.4. SQL Settings - Defaults page ΓòÉΓòÉΓòÉ
  6985.  
  6986. SQL Settings - Defaults page 
  6987.  
  6988. Use the SQL Defaults Page to select the case in which queries are submitted and 
  6989. the choice of default location. 
  6990.  
  6991. You select the default location from the Default Location pulldown. The 
  6992. location you choose appears pre-selected in the Location selector in the SQL 
  6993. window for any new XY-Query objects. 
  6994.  
  6995. To set the Case attribute, press a radio button to specify whether: 
  6996.  
  6997.      The query text remains as typed 
  6998.      The query text is translated to lower case when submitted. 
  6999.      The query text is translated to upper case when submitted. 
  7000.  
  7001.  
  7002. ΓòÉΓòÉΓòÉ 14.3.5. SQL Settings - Table Names page ΓòÉΓòÉΓòÉ
  7003.  
  7004. SQL Settings - Table Names page 
  7005.  
  7006. You can use the SQL Table Names Page to enter the names of the tables to be 
  7007. used when enquiries are made in order to present the list of available creators 
  7008. and tables on the Select Tables page of the Query Builder. By default the 
  7009. system catalogue tables are specified. However, this allows you to specify your 
  7010. own copy if required. 
  7011.  
  7012. For each particular type of location you can enter the table to use to retrieve 
  7013. details of all tables and the table to use to only retrieve details of tables 
  7014. to which you have the correct level of authority. 
  7015.  
  7016. Firstly, select the location type from the top selection list. This will cause 
  7017. the All Tables List and Authorised Tables List fields to be populated with the 
  7018. current setting for this location type. You can then change these entries as 
  7019. appropriate. When changes have been made for a location you must apply them 
  7020. before selecting another location type. 
  7021.  
  7022. The location types available for selection are as follows: 
  7023.  
  7024.      DB2 - OS/2 & AIX 
  7025.      DB2 - MVS 
  7026.      DB2 - SQL/DS 
  7027.      DB2 - AS400 
  7028.      XDB 
  7029.  
  7030.  
  7031. ΓòÉΓòÉΓòÉ 14.3.6. SQL Settings - Wildcards page ΓòÉΓòÉΓòÉ
  7032.  
  7033. The Wildcards page allows you to specify the default values for table creators 
  7034. and table names that will be passed to every new XY-Query object when it is 
  7035. created. The wildcards are used to limit the amount of data retrieved into the 
  7036. Select Tables page of the Builder. 
  7037.  
  7038. The wildcards can be specified in various forms. If an exact match is required 
  7039. then the exact text should be entered, for example USERID. If a fuzzy match is 
  7040. required then the wildcard can be specified as for example U* or *SER*. 
  7041.  
  7042. Note:  The wildcard indicator can be either an asterisk ,* , or a percentage 
  7043. sign, %. 
  7044.  
  7045. When multiple wildcards are specified then creators or table names will be 
  7046. returned that match any of the wildcards. 
  7047.  
  7048. In addition to the wildcards it is possible to request that tables owned by you 
  7049. are returned. In order to reduce the list still further it is possible to 
  7050. request that only tables to which you have the correct authority, depending 
  7051. upon the type of query being built, be returned. 
  7052.  
  7053.  Creators List     Use this to specify up to 40 wildcards to use to limit the 
  7054.                    number of entries returned into the Creators list of the 
  7055.                    Select Tables page in the builder. 
  7056.  Tables List       Use this to specify up to 40 wildcards to use to limit the 
  7057.                    number of entries returned into the Table names list of the 
  7058.                    Select Tables page in the builder. 
  7059.  List "My Tables"  Select this to ensure that tables owned by you are retrieved 
  7060.  List Granted Tables Only Select this to limit the list of tables returned to 
  7061.                    those for which you have the correct authority granted. 
  7062.  
  7063.  
  7064. ΓòÉΓòÉΓòÉ 14.4. Viewer settings ΓòÉΓòÉΓòÉ
  7065.  
  7066. You use the Viewer Settings notebook to tailor attributes that are relevant 
  7067. primarily for the Viewer. 
  7068.  
  7069. See the following sections for explanations of its pages: 
  7070.  
  7071.      Viewer Settings - Presentation page 
  7072.      Viewer Settings - View page 
  7073.      Viewer Settings - Data Update page 
  7074.      Viewer Settings - Export page 
  7075.  
  7076.  
  7077. ΓòÉΓòÉΓòÉ 14.4.1. Viewer Settings - Presentation page ΓòÉΓòÉΓòÉ
  7078.  
  7079. Use the Presentation page to specify the default fonts and colours for the 
  7080. various regions of the XY-Query Viewer. 
  7081.  
  7082. The following list details the regions of the Viewer for which defaults can be 
  7083. specified from this page: 
  7084.  
  7085.      Headings 
  7086.      Column titles 
  7087.      The data 
  7088.      Totals 
  7089.      Footings 
  7090.      The selected (highlighted) area 
  7091.      The data found in a search 
  7092.      Background 
  7093.      The horizontal and vertical lines 
  7094.      The buttons on the Viewer when in table view 
  7095.  
  7096.  Select the Region for which to set defaults and then use the font 
  7097.  specification fields and the radio buttons in conjunction with the colour 
  7098.  matrix to set the attributes for the region. 
  7099.  
  7100.  The changes that can be made depend on the region.  For example, the Viewer 
  7101.  background does not require a font setting, only colours.  The number of 
  7102.  different parts of a region for which colours are set varies. For example, the 
  7103.  headings, column titles, data, totals and footings regions need only a 
  7104.  foreground colour, whereas the buttons region needs four colours: 
  7105.  
  7106.      Top 
  7107.      Middle 
  7108.      Lower 
  7109.      Cell Tag. 
  7110.  
  7111.  The top, middle and lower colours apply to these parts of the buttons used to 
  7112.  select rows and columns.  The cell tag colours apply to the small buttons used 
  7113.  to select individual cells. 
  7114.  
  7115.  When you have completed the default specification for each region, press the 
  7116.  Apply button to register the new settings for the specific region. 
  7117.  
  7118.  
  7119. ΓòÉΓòÉΓòÉ 14.4.2. Viewer Settings - View page ΓòÉΓòÉΓòÉ
  7120.  
  7121. Viewer Settings - View page 
  7122.  
  7123. Use the Viewer View Page to determine the default View and Mode in which the 
  7124. Viewer will be displayed when a new XY-Query object is created. 
  7125.  
  7126. Make your selection for the default View from the following: 
  7127.  
  7128.      Report 
  7129.      Form 
  7130.  
  7131.  Make your selection for the default Mode from the following: 
  7132.  
  7133.      Browse 
  7134.      Update 
  7135.  
  7136.  
  7137. ΓòÉΓòÉΓòÉ 14.4.3. Viewer Settings - Data Update page ΓòÉΓòÉΓòÉ
  7138.  
  7139. You use the Data Update page to specify the default mode you wish to use for 
  7140. the update of the data displayed in the Viewer. 
  7141.  
  7142. Viewer Settings - Data Update page 
  7143.  
  7144. You select an option from the following: 
  7145.  
  7146.       No Update 
  7147.  
  7148.       Select this if no updates are to be allowed to the Viewer data. 
  7149.       Update report Only 
  7150.  
  7151.       Select this to allow updates to be made to the data without issuing any 
  7152.       update requests to the underlying table. 
  7153.       Update Table On Request 
  7154.  
  7155.       Select this to allow updates made to the data to be issued to the 
  7156.       underlying table. The update requests are pended unitl you specifically 
  7157.       request their issue. 
  7158.       Update Table By Cell 
  7159.  
  7160.       Select this to automatically issue a table update request when a single 
  7161.       data cell is changed. 
  7162.       Update Table By Row 
  7163.  
  7164.       Select this to automatically issue a table update request when updates to 
  7165.       a single row have been completed. 
  7166.       Update Table By Block 
  7167.  
  7168.       Select this to automatically issue table update requests when a 
  7169.       pre-determined number of rows have been changed. This value is set using 
  7170.       the Block Size spin button. 
  7171.  
  7172.  
  7173. ΓòÉΓòÉΓòÉ 14.4.4. Viewer Settings - Export page ΓòÉΓòÉΓòÉ
  7174.  
  7175. Viewer Settings - Export page 
  7176.  
  7177. Use the Export Page to specify how XY-Query data is exported in the form of 
  7178. ASCII delimited (.DEL) or Comma Separated Variable (.CSV) files. 
  7179.  
  7180. You can change these details: 
  7181.  
  7182.       Column delimiter 
  7183.  
  7184.       Use this field to specify the column delimiter that is used to separate 
  7185.       columns of data in the files. 
  7186.       Character string delimiter 
  7187.  
  7188.       Use this field to specify the character to be used to delimit strings in 
  7189.       the files. 
  7190.       Decimal separator character 
  7191.  
  7192.       Use this field to specify the character to be used as the decimal 
  7193.       separator in decimal numbers exported in the files. 
  7194.  
  7195.  
  7196. ΓòÉΓòÉΓòÉ 14.5. Chart settings ΓòÉΓòÉΓòÉ
  7197.  
  7198. You use the Chart Settings notebook to tailor attributes that are relevant 
  7199. primarily for the Chart Window. See the following sections for explanations of 
  7200. its pages: 
  7201.  
  7202.      Chart Settings - Types page 
  7203.      Chart Settings - Titles page 
  7204.      Chart Settings - Axes page 
  7205.      Chart Settings - Labels page 
  7206.      Chart Settings - Legend page 
  7207.      Chart Settings - Background page 
  7208.  
  7209.  
  7210. ΓòÉΓòÉΓòÉ 14.5.1. Chart Settings - Types page ΓòÉΓòÉΓòÉ
  7211.  
  7212. Chart Settings - Types page (for Bar charts) 
  7213.  
  7214. Use the Chart Types page to specify the default settings for the types of chart 
  7215. available within XY-Query. Each type of chart has its own distinct set of 
  7216. attributes, termed 'Chart Styles' that you can tailor. 
  7217.  
  7218. By selecting the chart type for which defaults are to be set, the correct set 
  7219. of styles for that type of chart is shown. When the styles have been set for a 
  7220. particular type, press the Apply button. This action saves the settings before 
  7221. the next chart type is selected and a different set of styles is displayed. 
  7222.  
  7223. For each chart type an option to set Default Type is available. When this is 
  7224. set it means that for any new XY-Query object created, the default chart type 
  7225. is the type specified. Only one chart type can have the Default Type box 
  7226. checked. 
  7227.  
  7228.  
  7229. ΓòÉΓòÉΓòÉ 14.5.2. Chart Settings - Titles page ΓòÉΓòÉΓòÉ
  7230.  
  7231. Chart Settings - Titles page 
  7232.  
  7233. Use the Chart Titles page to define the default properties for all titles used 
  7234. in a chart. These defaults are passed to any new XY-Query object created. 
  7235.  
  7236. After selecting the Title, the default attributes for that Title can be set. 
  7237. For the Main Title and the Axes Titles you can set the default text of the 
  7238. title, the font to display the text, the foreground, background and outline 
  7239. colours of the box containing the title. You can also request that this box is 
  7240. displayed in the chart window with a shadow. 
  7241.  
  7242. For Pie titles, you can only set the font for the title text and the foreground 
  7243. and background colours for the text box. 
  7244.  
  7245. When the attributes have been set for a particular Title, you press the Apply 
  7246. button to save the settings before the next title is selected and the 
  7247. attributes for this title are displayed and modified. 
  7248.  
  7249. Note:  For the Main Title only it is possible to split the title over multiple 
  7250. lines by adding the characters /n at the point of a line break. For example, 
  7251. entering Salary Report/nBy Department would put the title on two lines. 
  7252.  
  7253.  
  7254. ΓòÉΓòÉΓòÉ 14.5.3. Chart Settings - Axes page ΓòÉΓòÉΓòÉ
  7255.  
  7256. Chart Settings - Axes page 
  7257.  
  7258. You use the Chart Axes page to define the default properties for all axes 
  7259. plotted on a chart. These defaults are passed to any new XY-Query object 
  7260. created. 
  7261.  
  7262. After selecting an axis, you can set the default attributes for that axis. For 
  7263. all axes, you can specify the font to display the axis text and the foreground 
  7264. and background colours of the boxes containing the text. You can also request 
  7265. gridlines be drawn for each axis. 
  7266.  
  7267. For the X-Axis only, you can specify the angle at which the axis text is 
  7268. written. For both Y axes, you can specify only the appearance and position of 
  7269. tickmarks on the axes. 
  7270.  
  7271. When the attributes have been set for a particular axis, press the Apply button 
  7272. to save the settings before the next axis is selected. 
  7273.  
  7274.  
  7275. ΓòÉΓòÉΓòÉ 14.5.4. Chart Settings - Labels page ΓòÉΓòÉΓòÉ
  7276.  
  7277. Chart Settings - Labels page 
  7278.  
  7279. You Use the Chart Labels page to define the default properties for Labels 
  7280. plotted on a chart. These defaults are passed to any new XY-Query object 
  7281. created. 
  7282.  
  7283. You can set the default font, foreground and background colours for the data 
  7284. labels and also the position on the chart that the labels should be drawn, if 
  7285. at all, relative to the series elements. 
  7286.  
  7287.  
  7288. ΓòÉΓòÉΓòÉ 14.5.5. Chart Settings - Legend page ΓòÉΓòÉΓòÉ
  7289.  
  7290. Chart Settings - Legend page 
  7291.  
  7292. You use the Chart Legend page to define the default properties for the Legend 
  7293. shown on a chart. These defaults are passed to any new XY-Query object created. 
  7294.  
  7295. You can select the default font, foreground, background  and outline colours 
  7296. for the legend box, and whether or not this box should be drawn with a shadow 
  7297. around it. You can also specify the default position of the legend relative to 
  7298. a chart, or suppress it altogether. 
  7299.  
  7300.  
  7301. ΓòÉΓòÉΓòÉ 14.5.6. Chart Settings - Background page ΓòÉΓòÉΓòÉ
  7302.  
  7303. You use the Chart Background page to define the default background colour for 
  7304. any chart.  This default is passed to any new XY-Query object created. 
  7305.  
  7306.  
  7307. ΓòÉΓòÉΓòÉ 14.6. Procedure settings ΓòÉΓòÉΓòÉ
  7308.  
  7309. You use the Procedure Settings notebook to tailor attributes that are relevant 
  7310. for the Procedure window. 
  7311.  
  7312.  
  7313. ΓòÉΓòÉΓòÉ 14.6.1. Procedure Settings - Presentation page ΓòÉΓòÉΓòÉ
  7314.  
  7315. You use the Presentation Page to determine the background and text colours and 
  7316. the font for the Procedure editor to be used by default in any new Procedure 
  7317. object. 
  7318.  
  7319.  
  7320. ΓòÉΓòÉΓòÉ 15. XY-Query command line interface ΓòÉΓòÉΓòÉ
  7321.  
  7322. You can invoke XY-Query and its settings facility from an OS/2 command line. To 
  7323. invoke XY-Query see Running XY-Query from the command line. To invoke the 
  7324. XY-Query settings facility see Invoking the XY-Query settings facility from the 
  7325. command line. 
  7326.  
  7327.  
  7328. ΓòÉΓòÉΓòÉ 15.1. Running XY-Query from the command line ΓòÉΓòÉΓòÉ
  7329.  
  7330. You can run XY-Query from an OS/2 command line to take advantage of the 
  7331. parameters available. 
  7332.  
  7333. The command to run XY-Query has the following syntax: 
  7334.  
  7335. XYQUERY <object-name> <optional parameters>
  7336.  
  7337. where: 
  7338.  
  7339. <object-name> is the name of the XY-Query object you want to run. If this name 
  7340. is not specified then an untitled XY-Query object is created. 
  7341.  
  7342. Where a parameter introduces further information, it is followed by a colon, 
  7343. and the string of information follows without a space.  You can use the 
  7344. following parameters: 
  7345.  
  7346.  /P            You should only use this option when a new XY-Query Procedure 
  7347.                object is required. It is not required if a Procedure object is 
  7348.                specified by name and is ignored if one is named. This parameter 
  7349.                is incompatible with the others in this list. It should only be 
  7350.                used as follows: 
  7351.  
  7352.                               XYQUERY /P
  7353.  
  7354.                Note:  If the /P option is inadvertently used in conjunction 
  7355.                with other parameters then XY-Query ignores the other parameters 
  7356.                with the exception of the object name. 
  7357.  /B            Use this to specify XY-Query to run in background mode, that is, 
  7358.                without displaying windows. 
  7359.  /O            Use this to specify an output file for the data produced by the 
  7360.                query.  For example: 
  7361.  
  7362.                               /O:C:\XYQUERY\DATA\OUTPUT.TXT
  7363.  
  7364.  /S            You can use this to specify an SQL query to run. You must place 
  7365.                the query in inverted commas. For example: 
  7366.  
  7367.                               /S:"SELECT * FROM USERID.STAFF"
  7368.  
  7369.                Note:  If the /S option is used XY-Query ignores any existing 
  7370.                object that has been specified either with or without the /Q 
  7371.                option. It always causes a new object to be created containing 
  7372.                the query specified. 
  7373.  /D            Use this to specify a database for the query.  You need this 
  7374.                when you specify a string with the /S parameter.  For example: 
  7375.  
  7376.                               /D:SAMPLE
  7377.  
  7378.  /Q            Use this to specify the XY-Query object to be invoked. 
  7379.                (Alternatively, this can be specified by <object-name>, as shown 
  7380.                in the syntax above.)  For example: 
  7381.  
  7382.                               /Q:C:\XYQUERY\WORK\ALLSTAFF
  7383.  
  7384.  File extensions Use this to specify the format of the output file. XY-Query 
  7385.                writes to the output file specified by the /O parameter, and 
  7386.                uses the appropriate format as indicated by the file extension 
  7387.                of the file you name in that parameter.  If you do not use a 
  7388.                file extension recognised by XY-Query, it writes the output 
  7389.                file, by default, in text format (.TXT).  You can use file 
  7390.                extension parameters to override this default format.  For 
  7391.                example, if you use these parameters: 
  7392.  
  7393.                               /O:OUTPUT.XXX /DIF
  7394.                XY-Query writes the output to a file called OUTPUT.XXX in 
  7395.                standard DIF format. 
  7396.  
  7397.                You can use the following file extension parameters: 
  7398.                    /DIF (standard Data Interchange Format) 
  7399.                    /DIFE (extended DIF), 
  7400.                    /DIFD (standard DIF with headings in data) 
  7401.                    /TXT  (Plain text) 
  7402.                    /CSV  (Comma Separated Variable) 
  7403.                    /DEL  (Delimited ASCII) 
  7404.                    /WSF  (Lotus 1-2-3 Worksheet format) 
  7405.  When you run XY-Query with a specified query, it prompts for any substitution 
  7406.  variables in the usual way. 
  7407.  
  7408.  
  7409. ΓòÉΓòÉΓòÉ 15.2. Invoking the XY-Query settings facility from the command line ΓòÉΓòÉΓòÉ
  7410.  
  7411. You can invoke any of the sections of the XY-Query Settings facility from an 
  7412. OS/2 command line by entering the command: 
  7413.  
  7414. XYQPRO <optional parameter>
  7415. The optional parameter determines which section of the Settings facility is 
  7416. required. 
  7417.  
  7418. The parameters you can specify are as follows: 
  7419.  
  7420.  /G            Specify XYQPRO /G to invoke the General Settings section of the 
  7421.                XY-Query Settings facility. 
  7422.  /S            Specify XYQPRO /S to invoke the SQL Settings section of the 
  7423.                XY-Query Settings facility. 
  7424.  /V            Specify XYQPRO /V to invoke the Viewer Settings section of the 
  7425.                XY-Query Settings facility. 
  7426.  /C            Specify XYQPRO /C to invoke the Chart Settings section of the 
  7427.                XY-Query Settings facility. 
  7428.  /P            Specify XYQPRO /P to invoke the Procedure Settings section of 
  7429.                the XY-Query Settings facility. 
  7430.  
  7431.  If no parameter is entered or an unrecognised parameter is specified the 
  7432.  default action is to show the General Settings notebook of the Settings 
  7433.  facility. 
  7434.  
  7435.  
  7436. ΓòÉΓòÉΓòÉ 16. Using XY-Query with spreadsheets ΓòÉΓòÉΓòÉ
  7437.  
  7438.  
  7439. ΓòÉΓòÉΓòÉ 16.1. Introduction ΓòÉΓòÉΓòÉ
  7440.  
  7441. XY-Query allows users of spreadsheets such as Microsoft EXCEL to access data 
  7442. from databases and display that data in their spreadsheets. As a spreadsheet 
  7443. user, you need have no interaction with or knowledge of XY-Query. 
  7444.  
  7445. XY-Query can be called from spreadsheets running in OS/2 or in Windows under 
  7446. OS/2. This data interchange facility is achieved via Dynamic Data Exchange 
  7447. (DDE). 
  7448.  
  7449. The spreadsheet application is started as normal. To cause XY-Query to retrieve 
  7450. data, you run a macro that contains details of the query to be executed by 
  7451. XY-Query as well as commands for initiating the DDE link between the 
  7452. spreadsheet application and XY-Query. 
  7453.  
  7454.  
  7455. ΓòÉΓòÉΓòÉ 16.2. Calling XY-Query from within a spreadsheet ΓòÉΓòÉΓòÉ
  7456.  
  7457. To invoke XY-Query from within a spreadsheet, you can run a macro in the normal 
  7458. way. 
  7459.  
  7460. EXCEL macrosheet used to retrieve data from a database 
  7461.  
  7462. EXCEL macrosheet used to retrieve data from a database illustrates a sample 
  7463. Microsoft EXCEL macrosheet used to retrieve data from the database SAMPLE, and 
  7464. then display this data on a new Microsoft EXCEL worksheet. 
  7465.  
  7466. Note:  For invocation from Microsoft EXCEL under WIN-OS/2, you must ensure that 
  7467. certain pre-requisite set-up activities have been performed. 
  7468.  
  7469.      Ensure the Dynamic Data Exchange option in the WIN-OS/2 Setup settings is 
  7470.       set to Public. 
  7471.      Ensure XYQDDE.EXE and XYQDDEL.DLL are referenced off the PATH setting in 
  7472.       the AUTOEXEC.BAT file on the boot drive. 
  7473.  
  7474.  The commands used in the Microsoft EXCEL macrosheet shown in EXCEL macrosheet 
  7475.  used to retrieve data from a database. The numbers in the list refer to the 
  7476.  numbers shown in the figure as follows: 
  7477.  
  7478.    1. The INITIATE macro must be called before attempting to access data from 
  7479.       the database. This macro establishes a communications mechanism between 
  7480.       the spreadsheet product and XY-Query. The form of the INITIATE macro must 
  7481.       be as shown in EXCEL macrosheet used to retrieve data from a database. 
  7482.    2. The POKE macro sends an XY-Query command string to XY-Query. The general 
  7483.       form of this POKE macro is as follows 
  7484.  
  7485.             POKE( ChannelId , Reference , XY-Query command string )
  7486.  
  7487.       where: 
  7488.       ChannelId          is the channel identifier returned from the INITIATE 
  7489.                          macro 
  7490.       Reference          is a unique user-defined reference tag for the 
  7491.                          XY-Query command to be run 
  7492.       XY-Query command string is the command string to be submitted to 
  7493.                          XY-Query, to generate the data from a remote database. 
  7494.                          It can use all the parameters available when you run 
  7495.                          XY-Query from the command line.  See XY-Query command 
  7496.                          line interface for details. 
  7497.  
  7498.       In EXCEL macrosheet used to retrieve data from a database, the XY-Query 
  7499.       command string to be executed is stored in the macro sheet cell A48. Cell 
  7500.       A48 is pointed to by the line labelled 10 in the example, and this 
  7501.       command string executes the SQL literal string "SELECT * FROM USERID.ORG" 
  7502.       against the database named SAMPLE and stores the data retrieved in the 
  7503.       file C:\XYQUERY\WORK\EXAMPLE.DIF. This data file is written in a format 
  7504.       compatible with a Microsoft EXCEL worksheet. 
  7505.    3. Any error generated by this POKE statement is reported back to the macro 
  7506.       sheet as a function return value of #REF!, and the macro ISERR() returns 
  7507.       TRUE if this is the case. The most likely cause of an error occurring on 
  7508.       a POKE statement is that XY-Query was not properly installed. 
  7509.    4. The POKE command to XY-Query causes XY-Query to run in the background, 
  7510.       and so the REQUEST macro must be used to determine when XY-Query has 
  7511.       completed running its command string to generate the data. 
  7512.  
  7513.       The general form of this REQUEST macro is as follows 
  7514.  
  7515.             REQUEST( ChannelId , Reference )
  7516.  
  7517.       where 
  7518.       ChannelId          is the channel identifier returned from the INITIATE 
  7519.                          macro 
  7520.       Reference          is the unique user-defined reference tag from the 
  7521.                          previous POKE macro. 
  7522.  
  7523.       At any given time, there may be many XY-Query commands waiting to be run, 
  7524.       each generated by a user-issued POKE macro.  Each POKE macro is uniquely 
  7525.       identified by the user-defined reference name. The REQUEST macro 
  7526.       determines the status of any of these outstanding XY-Query commands by 
  7527.       supplying the correct user-defined reference name. 
  7528.  
  7529.       The return code from the REQUEST macro is one of the following: 
  7530.           32766 - this means that this REQUEST macro has been previously 
  7531.            issued for the same reference name, which is not valid. 
  7532.           32765 - this means XY-Query has not yet completed retrieval of the 
  7533.            data requested from the matching POKE macro. 
  7534.           The return code from XY-Query, resulting from running the query. 
  7535.    5. If the REQUEST macro returns 32766, this example displays a message box 
  7536.       to warn you that this request has been previously issued for this 
  7537.       reference name. 
  7538.    6. If the REQUEST macro returns 32765, this example displays a message box 
  7539.       to warn you that XY-Query is still busy satisfying the data retrieval. 
  7540.    7. This is cell A34. The XY-Query instance has completed, and a message box 
  7541.       displays the XY-Query return code to you. 
  7542.    8. The worksheet generated by XY-Query is then loaded via the OPEN() macro. 
  7543.    9. When all required data has been retrieved from the database, the 
  7544.       TERMINATE() macro is called to close the channel linking the macrosheet 
  7545.       and XY-Query. The Channel identifier returned from the INITIATE macro is 
  7546.       supplied to the TERMINATE macro. 
  7547.   10. This is the XY-Query command to be executed. 
  7548.  
  7549.  
  7550. ΓòÉΓòÉΓòÉ 17. Installing XY-Query ΓòÉΓòÉΓòÉ
  7551.  
  7552.  
  7553. ΓòÉΓòÉΓòÉ 17.1. Requirements for installing XY-Query ΓòÉΓòÉΓòÉ
  7554.  
  7555. Make sure you have the Xyratex Query for OS/2 installation diskettes before 
  7556. attempting to install XY-Query. 
  7557.  
  7558.  
  7559. ΓòÉΓòÉΓòÉ 17.1.1. Suggested hardware requirements ΓòÉΓòÉΓòÉ
  7560.  
  7561. The minimum hardware configuration consists of: 
  7562.  
  7563.      Intel 80386 DX processor 
  7564.      8 MB Random Access Memory 
  7565.      3.5 MB free disk space 
  7566.  
  7567.  Note:  It is recommended that where possible XY-Query is installed on an HPFS 
  7568.  drive and that the swapper is on an HPFS drive. 
  7569.  
  7570.  XY-Query can be used in a standalone configuration to access locally stored 
  7571.  databases or a client configuration to access both local databases and remote 
  7572.  databases. 
  7573.  
  7574.  
  7575. ΓòÉΓòÉΓòÉ 17.2. Accessing local DB2/2 databases ΓòÉΓòÉΓòÉ
  7576.  
  7577. To access locally stored databases only, you need: 
  7578.  
  7579.      Operating system 
  7580.         -  OS/2 2.0 with Servicepak XR06055 or higher, or any higher level of 
  7581.            OS/2. 
  7582.      Database Management System 
  7583.  One of the following: 
  7584.         -  Extended Services 1.0 for OS/2 
  7585.         -  Database 2 OS/2 (Single User). 
  7586.  
  7587.  
  7588. ΓòÉΓòÉΓòÉ 17.3. Accessing XDB databases ΓòÉΓòÉΓòÉ
  7589.  
  7590. To access XDB databases, you need: 
  7591.  
  7592.      Operating system 
  7593.         -  OS/2 2.0 with Servicepak XR06055 or higher, or any higher level of 
  7594.            OS/2. 
  7595.      Database Management System 
  7596.         -  XDB 3.x or later client 
  7597.  
  7598.  XY-Query will connect to any XDB database server that is accessible using the 
  7599.  XDB client. This includes local, non network-aware XDB servers (as supplied 
  7600.  with XDB Workbench), XDB servers on another machine, or DB2/MVS hosts accessed 
  7601.  via XDB-Link. 
  7602.  
  7603.  The server that XY-Query connects to is determined by the "XDBSERVE" 
  7604.  environment variable. Upon a successful connect, XY-Query interrogates the 
  7605.  table SYSTEM.SYSXDB.SYSLOCALS to retrieve a list of locations known to that 
  7606.  server, which is added to the XY-Query "locations" list. This means that you 
  7607.  must have SELECT authority against this table in order for the location list 
  7608.  to be retrieved. If you do not have this authority then see your XDB database 
  7609.  administrator. 
  7610.  
  7611.  Note that it is possible to have both a DB2/2 client and an XDB client 
  7612.  installed on the same workstation. In this case, the XY-Query "locations" list 
  7613.  will consist of the DB2/2 catalog contents, in addition the XDB locations 
  7614.  stored in SYSTEM.SYSXDB.SYSLOCALS on the XDB server. 
  7615.  
  7616.  If problems are encountered accessing an XDB server using XY-Query, it is 
  7617.  worth trying to use the character-mode "XDB" interface to access the server 
  7618.  first. If this connects successfully, then XY-Query should also be able to 
  7619.  connect. 
  7620.  
  7621.  
  7622. ΓòÉΓòÉΓòÉ 17.4. Accessing remote DB2/2 databases ΓòÉΓòÉΓòÉ
  7623.  
  7624. A typical configuration involves a "Client/Server" setup, in which the client 
  7625. communicates database requests to a Database Server. Components of DB2/2 must 
  7626. be configured on both the client and server. 
  7627.  
  7628.  
  7629. ΓòÉΓòÉΓòÉ 17.4.1. Software required on the XY-Query Client workstation ΓòÉΓòÉΓòÉ
  7630.  
  7631. On the Client workstation, you need: 
  7632.  
  7633.      Operating system 
  7634.         -  OS/2 2.0 with Servicepak XR06055 or higher, or any higher level of 
  7635.            OS/2. 
  7636.      Database client software 
  7637.   One of the following: 
  7638.         -  Extended Services 1.0 for OS/2 installed with Remote Data Services 
  7639.         -  Extended Services Client Enabler for OS/2 
  7640.         -  Database 2 OS/2 (Single User) installed as client or client with 
  7641.            local databases 
  7642.         -  DB2/2 V1 Client-Enabling Distributed Feature for OS/2 
  7643.         -  Client Application Enabler/2. 
  7644.  
  7645.  Note: 
  7646.  
  7647.    1. The OS/2 Distributed Client Feature allows access only to remote 
  7648.       databases stored on a database server.  Local databases are not 
  7649.       supported.  The directory tool is not installed on the client, so the 
  7650.       remote databases must be catalogued using the command line. 
  7651.  
  7652.    2. For a NETBIOS client configuration, Communications Manager/2 is not 
  7653.       required.  Communications Manager/2 is required only to support an APPC 
  7654.       connection. 
  7655.  
  7656.    3. Lan Adapter and Protocol Support is contained in several products: 
  7657.  
  7658.           For LAN Server 3.0, use the NTS/2 disk to run LAPS.EXE (NTS/2 is 
  7659.            also available separately). 
  7660.           Lan Server 2.0 also contains Lan Adapter and Protocol Support (LAPS) 
  7661.            as part of the requestor component. 
  7662.  
  7663.       Note:  Lan Server 4.0 has Multi-Protocol Transport Services (MPTS) 
  7664.       instead of LAPS. 
  7665.  
  7666.  
  7667. ΓòÉΓòÉΓòÉ 17.4.2. Software required on the XY-Query Server workstation ΓòÉΓòÉΓòÉ
  7668.  
  7669. To access OS/2 databases, you need: 
  7670.  
  7671.      Operating system 
  7672.         -  OS/2 2.0 with Servicepak XR06055 or higher, or any higher level of 
  7673.            OS/2. 
  7674.      Database software 
  7675.  One of the following: 
  7676.         -  Extended Services 1.0 with Database Server for OS/2, 
  7677.         -  Database 2 OS/2 Client Server. 
  7678.  
  7679.  
  7680. ΓòÉΓòÉΓòÉ 17.5. Accessing Remote DB2 family databases ΓòÉΓòÉΓòÉ
  7681.  
  7682. In order for XY-Query Clients to access host databases that are DRDA 
  7683. Application Servers (e.g. SQL/DS, DB2/400 and DB2/MVS), DDCS/2 must be 
  7684. installed on the database server in addition to the above database server 
  7685. software. 
  7686.  
  7687. The version of DDCS/2 must match the version of the database server software, 
  7688. as shown below: 
  7689.  
  7690.  Extended Services 1.0    DDCS/2 1.0 
  7691.  DB2/2 1.0                DDCS/2 2.0 
  7692.  DB2/2 1.2                DDCS/2 2.2 
  7693.  DB2/2 2.1                DDCS/2 2.3 
  7694.  
  7695.  
  7696. ΓòÉΓòÉΓòÉ 17.5.1. Software required on the host ΓòÉΓòÉΓòÉ
  7697.  
  7698. On the host you need: 
  7699.  
  7700.      A level of DB2 that supports Distributed Relational Database Architecture 
  7701.       (DRDA). 
  7702.  
  7703.  Note:  A configuration that uses Distributed Database Connection Services/2 
  7704.  Single User (DDCS/2 Single User) to access host databases is also possible. 
  7705.  In this case, each client would require the appropriate level of database 
  7706.  management software as well as a version of Communications Manager to support 
  7707.  the APPC connection to the host.  Each client would have to be individually 
  7708.  defined to the host system. 
  7709.  
  7710.  
  7711. ΓòÉΓòÉΓòÉ 17.6. How to install XY-Query ΓòÉΓòÉΓòÉ
  7712.  
  7713. To install XY-Query, load the XY-Query installation diskette, change your 
  7714. directory to A: and enter: 
  7715.  
  7716. XYQINST
  7717. and follow the instructions on the panel. 
  7718.  
  7719. The installation program copies the XY-Query product files to a directory of 
  7720. your choice.  Overtype the input fields as necessary. 
  7721.  
  7722. XY-Query Installation panel 
  7723.  
  7724. You have three options: 
  7725.  
  7726.      Standard installation, that is installing XY-Query, automatic updating of 
  7727.       CONFIG.SYS and the OS/2 desktop. 
  7728.      Installing XY-Query product files only followed by a manual update of 
  7729.       CONFIG.SYS 
  7730.      Refreshing of XY-Query's OS/2 desktop folder 
  7731.  
  7732.  Each option is described below. 
  7733.  
  7734.  
  7735. ΓòÉΓòÉΓòÉ 17.6.1. Standard installation of XY-Query ΓòÉΓòÉΓòÉ
  7736.  
  7737. To install XY-Query, update CONFIG.SYS automatically and create the XY-Query 
  7738. OS/2 desktop folder, make sure that you select both the Install Product Files 
  7739. and Update Desktop and Configuration boxes and then press the OK button. 
  7740.  
  7741. XY-Query takes a back-up copy of CONFIG.SYS automatically and gives you the 
  7742. name of the back-up file when installation is complete. If the installation 
  7743. process cannot update the CONFIG.SYS file, you must update it manually as 
  7744. described below before you can run XY-Query. 
  7745.  
  7746. Your OS/2 desktop is updated as soon as the installation process is completed 
  7747. successfully. You must re-boot your machine before trying to use XY-Query so 
  7748. that the changes made to CONFIG.SYS take effect. 
  7749.  
  7750.  
  7751. ΓòÉΓòÉΓòÉ 17.6.2. Installing XY-Query product files only ΓòÉΓòÉΓòÉ
  7752.  
  7753. To install XY-Query product files only make sure that you select only the 
  7754. Install Product Files box and then press the OK button. 
  7755.  
  7756. You must then update the CONFIG.SYS file manually by adding or changing 
  7757. environment variables and updating the LIBPATH statement to reference the 
  7758. destination directory used in the installation process. The default destination 
  7759. directory is C:\XYQUERY. 
  7760.  
  7761. Make the changes shown below changing the default destination directory if 
  7762. necessary: 
  7763.  
  7764.  LIBPATH          Add reference to C:\XYQUERY 
  7765.  SET PATH         Add reference to C:\XYQUERY 
  7766.  SET DPATH        Add reference to C:\XYQUERY 
  7767.  SET HELP         Add reference to C:\XYQUERY 
  7768.  SET BOOKSHELF    Add reference to C:\XYQUERY 
  7769.  SET XYQPATH      Add this environment variable to refer to C:\XYQUERY 
  7770.  SET XYQWORK      Add this environment variable to refer to C:\XYQUERY\WORK 
  7771.  SET XYQTEMP      Add this environment variable to refer to C:\XYQUERY\TEMP 
  7772.  
  7773.  After updating CONFIG.SYS, re-boot your machine to make the updates effective. 
  7774.  You can then use XY-Query. 
  7775.  
  7776.  
  7777. ΓòÉΓòÉΓòÉ 17.6.3. Refreshing your OS/2 desktop only ΓòÉΓòÉΓòÉ
  7778.  
  7779. If the the XY-Query folder has been lost from your OS/2 desktop, you can 
  7780. re-instate the folder on your desktop without having to re-install XY-Query. 
  7781. You do this by selecting only the Update Desktop and Configuration box and 
  7782. pressing the OK push button. 
  7783.  
  7784. You can use this option provided that XY-Query has been installed previously. 
  7785. You do not need to re-boot your machine for the refresh to take effect. 
  7786.  
  7787. It is possible to re-install the same or later versions of XY-Query over an 
  7788. existing version. If you choose to do this the current desktop folder will be 
  7789. destroyed and re-created. The contents of the Work folder will not be affected. 
  7790. However, if you have placed any other folders or objects in the XY-Query 
  7791. desktop folder these will be lost when the desktop is destroyed. Therefore, it 
  7792. is advised that if you wish to re-create the desktop when you are installing 
  7793. over an existing version, any objects not originally created by XY-Query 
  7794. installation are moved from the desktop folder for safe-keeping prior to 
  7795. re-installation. 
  7796.  
  7797.  
  7798. ΓòÉΓòÉΓòÉ 17.7. Connecting to databases ΓòÉΓòÉΓòÉ
  7799.  
  7800.  
  7801. ΓòÉΓòÉΓòÉ 17.7.1. Connecting to a local database ΓòÉΓòÉΓòÉ
  7802.  
  7803. Local databases are managed by DB2/2, Database Manager, or XDB, and need no 
  7804. additional configuration.  XY-Query automatically binds itself to the database 
  7805. if required when you run the first query against that database. 
  7806.  
  7807. (XY-Query will access local XDB locations without any requirement to bind). 
  7808.  
  7809.  
  7810. ΓòÉΓòÉΓòÉ 17.7.2. Connecting to remote DB2 databases ΓòÉΓòÉΓòÉ
  7811.  
  7812. XY-Query accesses remote DB2/2 databases using NETBIOS or APPC connections 
  7813. directly to the database server, and remote host DRDA compliant databases 
  7814. through DDCS/2. 
  7815.  
  7816. There are two versions of DDCS/2: 
  7817.  
  7818.      Single-user 
  7819.      Multi-user 
  7820.  
  7821.  In the single-user configuration, each workstation has a separate DDCS/2 
  7822.  program connected to the DBMS. 
  7823.  
  7824.  In the multi-user configuration, each workstation is connected to a single 
  7825.  DDCS/2 which is connected to the DBMS. 
  7826.  
  7827.  Note:  Note that each single-user configuration requires an LU6.2 connection 
  7828.         while the multi-user configuration requires only one.  In the 
  7829.         multi-user configuration, however, each workstation is simply connected 
  7830.         to the DDCS/2 server via Remote Data Services (RDS). 
  7831.  
  7832.  In a multi-user configuration, if a user wishes to access remote databases on 
  7833.  the host (DB2) as well as those catalogued as local to the server, the user 
  7834.  must have the same userid and password on the server as on the host. 
  7835.  
  7836.  If access is required to DB2/400 databases, create a new collection called XYQ 
  7837.  before trying to run XY-Query against it. 
  7838.  
  7839.  See the Guide to SAA Distributed Database Connection Services/2 for more 
  7840.  information on setting up these facilities. 
  7841.  
  7842.  
  7843. ΓòÉΓòÉΓòÉ 17.8. Binding to remote databases ΓòÉΓòÉΓòÉ
  7844.  
  7845. XY-Query attempts to bind automatically to remote databases. If you do not have 
  7846. the correct authority then a database administrator will need to bind XY-Query 
  7847. to each remote database.  To do this, use the SQLBIND command and one of the 
  7848. three bind files supplied with XY-Query (XYQSQL16.BND, XYQSQL32.BND or 
  7849. XYQSQL21.BND). 
  7850.  
  7851. Issue only one of these commands depending on your local client Database 
  7852. Management system where <RemoteDB> represents the database name (fully qualify 
  7853. the path name of the bind file SQLBIND command if necessary: 
  7854.  
  7855.      For Database Manager, use the command: 
  7856.  
  7857.               SQLBIND XYQSQL16.BND <RemoteDB>  /* Database Mgr.  */
  7858.  
  7859.      For DB2 for OS/2 Version 1.x, use the command: 
  7860.  
  7861.               SQLBIND XYQSQL32.BND <RemoteDB>  /* DB2/2 Vers 1.x */
  7862.  
  7863.      For DB2 for OS/2 Version 2.x, use the command: 
  7864.  
  7865.               SQLBIND XYQSQL21.BND <RemoteDB>  /* DB2/2 Vers 2.x */
  7866.  
  7867.  Note:  The SQLBIND only needs to be performed once to each DB2 system per 
  7868.  install of XY-Query so long as the GRANT EXECUTE has been issued.  The SQLBIND 
  7869.  uses a collection ID of XYQ and package names of XYQ1620E, XYQ3220E and 
  7870.  XYQ2120E  You must have the appropriate authority to perform each SQLBIND 
  7871.  (PACKADM or CREATE on collection XYQ). 
  7872.  
  7873.  The package name matches the bind file as follows 
  7874.  
  7875.       XYQSQL16.BND XYQ1620E 
  7876.       XYQSQL32.BND XYQ3220E 
  7877.       XYQSQL21.BND XYQ2120E 
  7878.  
  7879.  
  7880. ΓòÉΓòÉΓòÉ 17.8.1. Granting access to a database ΓòÉΓòÉΓòÉ
  7881.  
  7882. Each user must be given access to each database as follows: 
  7883.  
  7884.    1. Catalogue the database in the local DBMS. 
  7885.  
  7886.       To catalogue the database in the local DBMS, use the Directory Tool 
  7887.       feature of Database Manager or DB2/2 and follow the instructions in the 
  7888.       IBM Extended Services for OS/2 Guide to Database Manager, or the DB2/2 
  7889.       manual IBM Database 2 OS/2 Guide. 
  7890.    2. Grant the user authority to execute the XY-Query package 
  7891.  
  7892.       To let a user run XY-Query, you must grant execute access to the package. 
  7893.       For example, use the following command to grant access to a user to run 
  7894.       XY-Query against a DB2 system. 
  7895.  
  7896.                GRANT EXECUTE
  7897.                ON PACKAGE XYQ.XYQ2120E
  7898.                TO <userid>
  7899.       where <userid> represents the userid of the user to whom you want to give 
  7900.       access. 
  7901.  
  7902.       Note:  For simplicity it is advisable that you grant access to all three 
  7903.       package names when the access is for a central database and you have 
  7904.       users using different levels of database software. 
  7905.  
  7906.       Depending on whether you choose PUBLIC or an individual userid, this 
  7907.       command allows all users or a specified user possessing the necessary 
  7908.       authority to run queries against the database. 
  7909.    3. Give each user the necessary authority (SELECT, UPDATE etc.) for each 
  7910.       database. 
  7911.  
  7912.  
  7913. ΓòÉΓòÉΓòÉ 17.8.2. Connecting to a remote XDB database. ΓòÉΓòÉΓòÉ
  7914.  
  7915. The file XDBSQLXD.DBR (the DBRM file for XY-Query) has been provided if it is 
  7916. necessary to bind XY-Query to a remote DB2 database accessed via XDB-Link. 
  7917.  
  7918.  
  7919. ΓòÉΓòÉΓòÉ 17.9. Upgrading your level of DB2/2 ΓòÉΓòÉΓòÉ
  7920.  
  7921. When you start XY-Query for the first time, it will examine your system to 
  7922. determine what type of DB2/2 database requestor is installed. This information 
  7923. is stored as the DatabaseType entry in the file XYQ.CFG in your installation 
  7924. directory.. 
  7925.  
  7926. It can have one of the following values: 
  7927.  
  7928.      DBM (for Extended Services 1.0) 
  7929.  
  7930.      DB2 (for DB2/2 1.x or CAE/2 1.x) 
  7931.  
  7932.      V21 (for DB2/2 2.x or CAE/2 2.x) 
  7933.  
  7934.  An example of the line in the XYQ.CFG file containing this information 
  7935.  follows: 
  7936.  
  7937.   DatabaseType = DB2
  7938.  
  7939.  If you subsequently upgrade the database requestor software after running 
  7940.  XY-Query, the value stored in the XYQ.CFG file will be incorrect. 
  7941.  
  7942.  Deleting the DatabaseType line from the XYQ.CFG file will force XY-Query to 
  7943.  re-examine your system and determine the correct type of database requestor 
  7944.  next time it is started. 
  7945.  
  7946.  Note:  It is recommended that if you run XY-Query on a DB2/2 2.x system, 
  7947.  either the command DB2START should be added to STARTUP.CMD, or the Start DB2 
  7948.  object should be shadowed into the Startup folder. 
  7949.  
  7950.  
  7951. ΓòÉΓòÉΓòÉ 17.10. Creating the DB2/2 sample database. ΓòÉΓòÉΓòÉ
  7952.  
  7953. The figures and examples in this document are based on the database, called 
  7954. SAMPLE, supplied with DB2/2. If this database has not been installed, you can 
  7955. install it provided that you have a local administrator's account. 
  7956.  
  7957. You create this database by issuing a single command from an OS/2 command line. 
  7958. If you have DB2/2 V1.x installed, issue the command: 
  7959.  
  7960.               SQLSAMPL
  7961. or if you have DB2/2 V2.x installed, issue the command: 
  7962.  
  7963.               DB2SAMPL
  7964.  
  7965.  
  7966. ΓòÉΓòÉΓòÉ 17.11. Removing XY-Query ΓòÉΓòÉΓòÉ
  7967.  
  7968. To remove XY-Query, choose one of the following: 
  7969.  
  7970.      Double-click on the icon labelled Remove in the desktop folder 
  7971.      Issue the following command from an OS/2 command line: 
  7972.  
  7973.             XYQINST /remove
  7974.  
  7975.  XY-Query is then removed completely. Both the directory structure set up at 
  7976.  installation and the updates to CONFIG.SYS are removed. 
  7977.  
  7978.  Note:  After removal of XY-Query re-boot your machine to make the removal 
  7979.  effective. 
  7980.  
  7981.  
  7982. ΓòÉΓòÉΓòÉ 17.12. Advanced installation and removal options ΓòÉΓòÉΓòÉ
  7983.  
  7984.  
  7985. ΓòÉΓòÉΓòÉ 17.12.1. Installation Parameters ΓòÉΓòÉΓòÉ
  7986.  
  7987. The XYQINST program has a number of parameters which can be set from the 
  7988. command line, or from icon settings, or can be set up by any other program 
  7989. which wishes to run XYQINST.EXE. 
  7990.  
  7991. A complete list of these parameters is as follows. 
  7992.  
  7993.  -tTargetDir              Directory to install into Default is the value of the 
  7994.                           XYQPATH variable else its c:\xyquery 
  7995.  
  7996.  -sSourceDir              Directory to install from Default is the directory 
  7997.                           XYQINST.EXE is executing from 
  7998.  
  7999.  -p[Y|N]                  Install program files Default is -pY 
  8000.  
  8001.  -d[Y|N]                  Install desktop icons Default is -dY 
  8002.  
  8003.  -c[Y|N]                  Modify config.sys Default is -cY 
  8004.  
  8005.  -i[N|Y]                  Autostarted, invisible install, do not show dialog if 
  8006.                           -iY, show it if -iN Default is -iN 
  8007.  
  8008.  -a[N|Y]                  Autostarted visible install, dialog is visible, but 
  8009.                           install button is auto pressed and started. Recommend 
  8010.                           use with -fY. -aY is mutually exclusive with -iY. If 
  8011.                           you use both -iY takes precedence. 
  8012.  
  8013.  -f[N|Y]                  Freeze panel. This is only ever effective if -aN is 
  8014.                           used. -fY prevents the user from modifying the 
  8015.                           installation options on the panel. The only available 
  8016.                           options will be the Install, Cancel and Help buttons. 
  8017.                           Default is -fN 
  8018.  
  8019.  -vwWorkDir               Specify the work directory. If the directory name 
  8020.                           starts with a \ or a drive: then this directory is 
  8021.                           used as specified. If it does not start this way it 
  8022.                           is taken as a subdirectory of the target directory 
  8023.                           Default is -vwWork. 
  8024.  
  8025.  -vmTempDir               Specify the temp directory. If the directory name 
  8026.                           starts with a \ or a drive: then this directory is 
  8027.                           used as specified. If it does not start this way it 
  8028.                           is taken as a subdirectory of the target directory 
  8029.                           Default is -vmTemp. 
  8030.  
  8031.  -vtTemplatesDir          Specify the templates directory. If the directory 
  8032.                           name starts with a \ or a drive: then this directory 
  8033.                           is used as specified. If it does not start this way 
  8034.                           it is taken as a subdirectory of the target directory 
  8035.                           Default is -vtTemplates, (or -vtTemplate for FAT 
  8036.                           drives). 
  8037.  
  8038.  -vsSamplesDir            Specify the samples directory. If the directory name 
  8039.                           starts with a \ or a drive: then this directory is 
  8040.                           used as specified. If it does not start this way it 
  8041.                           is taken as a subdirectory of the target directory 
  8042.                           Default is -vsSamples. 
  8043.  
  8044.  -remove                  This will cause a full deletion of &XY-Query. Only 
  8045.                           the following options will work with -remove 
  8046.                           -vwWorkDir   -vmTempDir  -vtTemplatesDir 
  8047.                           -vsSamplesDir -tTargetDir  -a[N|Y]      -f[N|Y] 
  8048.  
  8049.  Each parameter above is shown with its options in square brackets, e.g. 
  8050.  -a[N|Y]. What this means is that the -a paramater can be written as -a, -an or 
  8051.  -ay. Because the N is the first item in the brackets it means that -a actually 
  8052.  means -aN, hence -aN is the default. This default is also used if the 
  8053.  parameter is not specified at all. So, for instance, if you just use the -pY 
  8054.  parameter then the default value for all other parameter is used so the -a 
  8055.  parameter is taken as -aN. 
  8056.  
  8057.  Where dirctories are specified in parameters you can give them in two ways. 
  8058.  For instance, suppose XY-Query was installed in a target directory of C:\XYQ. 
  8059.  You could specify that the samples appear in a subdirectory of this called 
  8060.  SAMPS\NEW by specifying -vssamps\new. This will put the samples in 
  8061.  C:\XYQ\SAMPS\NEW, i.e. underneath the target directory. Alternatively, if you 
  8062.  do not wish to use the target directory you could specify -vsd:\mysamps for 
  8063.  install xyquery in C:\XYQ, and the samples in D:\MYSAMPS. The use of the drive 
  8064.  letter (e.g. D:) is crucial for XYQINST to determine what you actually want to 
  8065.  do. 
  8066.  
  8067.  Note:  These parameters are not case sensitive which means you can mix capital 
  8068.  and small letters where you please without affecting their meaning. In 
  8069.  addition the parameters may start with either a '-' character or a '/' 
  8070.  character. 
  8071.  
  8072.  
  8073. ΓòÉΓòÉΓòÉ 17.12.2. LAN, Remote or CID installation ΓòÉΓòÉΓòÉ
  8074.  
  8075. It is possible to start the XYQINST program as part of another program to 
  8076. execute either from a LAN or from diskettes. 
  8077.  
  8078. To install from a LAN first install the program files only with the appropriate 
  8079. LAN directory as the target directory. Then any user can go into that directory 
  8080. and execute XYQINST to install on to their own machine. 
  8081.  
  8082. If you wish to execute XYQINST from another program that is also possible. Be 
  8083. warned that XYQINST.EXE and its help file XYQINST.HLP must be together in the 
  8084. same directory. Simply execute the XYQINST.EXE program as desired specifying 
  8085. the appropriate command line parameters to get the result you want. 
  8086.  
  8087. The program can be made to run invisibly by using the -iY parameter. This can 
  8088. be used to make &XY-Query installation appear to be a part of your own 
  8089. installation. 
  8090.  
  8091. Note:  If installation is from diskette then even if the -iY parameter is used 
  8092. a dialog box prompting for the next diskette will still appear.