# Query Subsystem

Column Options |

For a Data Dictionary/View Definition/Database Table

When you select an item from the File Elements list in the Query Definition window, it is placed in the Columns list with default values for its title, format width and query derived from the data dictionary, view or table definition.

To change the values for a selected element, launch the Column Options window by using one of the following methods:

• Click the Column Options button on the Query Definition toolbar.
• Double click on the element.
• Right click on the element and then select Update column properties from the popup menu.

The Column Options window for the selected element is displayed:

For a Manually-Defined File

When you select a manually defined file from the File Elements list in the Query Definition window and click the selection button, the Column Options window is presented for defining the data element in terms of field number, offset, size and data type. See Field Definition and Manual Field Definition.

The Column Options window consists of the following:

Field Definition | (Only Available for Manually-Defined Files)
Field No | Ordinal position of the field to be displayed; i.e. range 1 to n. Use Fld#0 (zero) to refer to an external key to a manual file.
Offset and Size | Define sub-strings using the field Offset (integer, range 1 to n) and the Size of the sub-string (integer, number of characters/bytes). NOMADS displays manual fields in the Columns list as Fld#n (where n is the Field No) or as Fld#n(o,z) for sub-strings (where o is the offset and z is the size).
Type | Toggle String or Numeric as your data type.
Title | Heading that users will see at the top of the column at run time (either a Fixed value, string Expression or Message Library Reference).
Width | Column width in columns. This can be adjusted as necessary, depending on the selected font. Column widths can also be adjusted in Query+ Toolbar, Hybrid, Menu and Drop Query views (see Query View option) by clicking the Test/Design toolbar button to display the query and dragging the column header to the desired size. Click the Save + Exit button to save and incorporate these settings into the query definition when exiting the query. (The ability to save query changes when in Test/Design mode was added in PxPlus 2023 Update 1.)
Alignment | (Query+ and Drop Query) Alignment of the value within the column. Settings include Default, Left, Center and Right justification. The Default setting for text values is Left justification and Right justification for numeric values. #### Note: Alignment affects text displays only so that just the column title of columns displaying images, percent bars, etc. are affected. (The Alignment option was added in PxPlus 2018.)
Format | Can be either Mask or Program:
Mask | PxPlus format mask for the column's data output (Fixed value or string Expression); e.g. a phone number mask such as 000-000-0000.
Program | Name of the program called to format the display of the string data in this column; e.g. *win/date;display. On the ENTER statement of the sub-program, include one argument (value of the column is passed by your query). Fixed text or an Expression can define the mask or name the program.
Display Option | Click the Define button to launch the Query Column Display window where you can assign visual attributes, such as bold text, text color, highlight color, or an image, to a column. See Query Column Display below.
Sort Options | (String Only, Query+, Drop Query and Classic Query with Sort by Column Option) The following sort options can be assigned to a column: Sort As Is; Use Sort Algorithm; Date Sort:
Sort Algorithm | (Available when Use Sort Algorithm option is selected) Enter a PxPlus expression to be used as an alternate algorithm for sorting the column. Example: A column containing a date stored in a MMDDYYYY format can be displayed as MM/DD/YYYY using a "XX/XX/XXXX" format mask. However, to sort the column chronologically by year, month, day, you can set up a sort algorithm such as DT$(5,4)+DT$(1,2)+DT$(3,2).
#### Note: While this would be necessary for proper sorting in a Classic Query, Query+ and Drop Query can use the Date Sort to accomplish this as well.
Sort Key Length | (Available when Use Sort Algorithm option is selected) Number of characters to be used to sort the column when using a sort algorithm. Default value is the length of the field to a maximum of 128.
Date Sort | (Query+, Drop Query) (Available when Date Sort option is selected) Enter or select a string consisting of D, M and/or Y (day, month year) to describe the order in which they occur in the data. Example: A date in the format MMDDYY would be MDY.
'Tip' Values | (Numeric Only, Query+, Drop Query and Classic Query with Sort by Column Option) (Optional) Tip values to be displayed when the mouse is placed over the column heading. Values include Total, Average, Minimum and Maximum. Column tips are also supported in Webster+ queries. See Webster+ query=xxx. (Webster+ support for column tips was added in PxPlus 2024.)
Hotlink Logic | (Query+ and Drop Query) Logic to execute when the column is double clicked. Click the drop-down arrow for a list of event actions: Ignore, Link, Call and Execute. See Actions and Parameters. The specified logic overrides selecting the query record. Columns with a hotlink are displayed in the color defined by the 'OPTION'("StdLvueHotlinkClr",color$) setting and are underlined while hovering over the column. See OPTION mnemonic.
Webster Hotlink | Specify a hotlink for the column to be used in a Webster+ environment. Links may specify URLs, pages or events, starting with http://, https://, page: or event:. Additional URL parameters can follow the page/program name separated by an & (ampersand); e.g. &fieldname$=. Example: page:pagename&fieldname$=$1 The Webster+ hotlink is translated into a Webster+ [link] short code: [link page:pagename&fieldname$=$1] This results in a hyperlink to the specified page name with fieldname$ as the variable to be passed to the page/program and $1 being substituted with the value in the column.
Target | (Optional) Specify a Webster+ target browser window where the results of a link or event will be displayed. Selections are null (Default), Same, New or Popup.
Same | To have the output replace the current page.
New | To create a new tab/window.
Popup | To create a popup overlaid window. When selected, an input control with a % (percent sign) is displayed for entering the percentage of the screen the popup window will occupy.
(The Hotlink Logic option was added in PxPlus 2018.) (The Webster Hotlink option was added in PxPlus 2021 Update 1.)
Query | (Classic Query Only) Optional sub-query assigned to the column.
Library | Select a library name from the drop-down list, click the Browse button to look through the directory structure to find the library or type the library path. An expression can also be entered by preceding the expression with an = (equals sign); e.g. =libname$ or ="mylib.en". #### Note: The Library name may be a specific or generic reference. See Cascading Language Suffixes.
Panel | Identify the query object to be used as a sub-query by selecting it from the drop-down list of available query panel names.
At run time, users can invoke the sub-query by highlighting the column title and clicking the enabled query button on the toolbar. The current contents of the query column are passed as the Start At Value for the sub-query. (Support for entering an expression for a Library name was added in PxPlus 2019.)
Initially Hide Column | Select this option to initially hide the column at run time until the user selects it to be shown. When using Query+ Toolbar, Hybrid, Menu or Drop Query views (see Query View option), columns can be set to be initially hidden or shown by clicking the Test/Design toolbar button to display the query and selecting the Show/Hide/Reorder Columns item from the Columns run-time option to set the visibility. Click the Save + Exit button to save and incorporate these settings into the query definition when exiting the query. (The ability to save query changes when in Test/Design mode was added in PxPlus 2023 Update 1.)
Security | Launches the Object Security Definition window for setting up column level security for the query. See Query Security. (The Security button was added in PxPlus 2021.)

## See Also

Query Definition