Reporting > Native reporting system > Reporting system command language > SELECT command
  
SELECT command
Editing or adding layout instructions for the report fields
Use the SELECT command to specify the field-identifiers and column layout for a report. A field-identifier is the actual field names or column headings to be printed in a Tabular report. For example, some valid field-identifiers are: Name, Update Date, Audit, or Type. A valid field-identifier is any field name in the database; both predefined fields (see Predefined fields) and user-defined fields (see FIELD command) can be reported.
The SELECT command is used to select data to be printed. It can be thought of as a synonym for “print a column called”.
See also:
Select state transition diagram name
Select column header appearance
Select column header and placement
Select column header name
Printing one or more columns
SELECT command structure
{ SELECT field-identifier-1 subcommand qualifier, field-identifier-2 subcommand qualifier }
The SELECT command uses field-identifiers which can be followed by a series of subcommands and subcommand-identifiers used to position the field on the page, specify the font to be used for the field, and the position of each field’s legend. Commas are placed between the field-identifier group, not between the subcommands.
For example, by default, the field-identifier name is also the name of the column header in the report. But suppose Name is too vague for that column header because it is really the “symbol name”. To print Symbol Name as the column heading, the command statement looks like this:
This graphic is described in the surrounding text.
Rules for using the SELECT command
To create a correct SELECT command statement (including field-identifiers, subcommands, and subcommand qualifiers), follow these rules:
1 Follow each SELECT command with a field-identifier, its related subcommands, and their respective subcommand-identifiers and separate each subcommand group with a comma.
2 Use white space to separate the SELECT command, subcommand, and subcommand-identifier.
3 Place a comma immediately after the last subcommand-identifier in a group with no white space between the comma and subcommand-identifier. White space must follow the comma.
4 Start a new line for each field (property) whose characteristics are being defined when a field has multiple formatting specifications. Each new line begins with the SELECT command, followed by the first field, followed by the first set of placement and font specifications, followed by a comma. It is the comma that separates one field from another. Repeat that sequence for each new line. This extra notation makes the file more readable.
5 The SELECT command places property names in columns from left to right across the page. If the fields exceed the space available on the page, columns are wrapped onto the next line. When fields are wrapped onto another line, the field legends are wrapped onto another line also.
6 To control how columns are placed on the report, choose to use one SELECT command with multiple field identifiers which produces a report with one column. Or, use multiple SELECT commands each with its own field identifier which produces a report with the number of columns equal to the number of SELECT command used. In other words, each iteration of SELECT produces a new line in the report.
See also:
Printing one or more columns
Select column header and placement
Select column header name
Select state transition diagram name
At the diagram level of the Entity Table, information on all State Transition diagrams in the encyclopedia is placed in the extraction database. See also WHERE command.
SELECT Name, WHERE Class = Diagram, WHERE Type = "State Transition"
Select column header appearance
Use these subcommands to refer to a previously defined font and use its characteristics to print a column header.
{ SELECT field-identifier
FONT font-identifier
Use the FONT subcommand to print and position the column heading.
LEGENDFONT font-identifier
Use the LEGENDFONT subcommand to print and position the column heading.
See also:
Printing one or more columns
Select column header and placement
Select column header name
Examples: SELECT command
These are some of the most commonly used SELECT subcommands and a description of what the subcommand will do to how the report columns are formatted.
Example 1
This command specifies “Print two stacked report columns; one labeled Name, one labeled Type”.
SELECT Name, Type
Example 2
This command specifies “Print column heading Used by Attribute instead of Name. Align the label at column left. Make the heading font size point 6. Make the column two inches wide”.
SELECT "Name" LEGEND "Used by
Attribute" LABEL LEFT
LEGENDFONT Font6 WIDTH 2.00
Example 3
This command specifies “Print a column heading of Index instead of Name. In side-by-side rows also print these fields: Clustered, DB Space, Fill Factor, and FillfFactor”.
SELECT "Name" LEGEND "Index"
SELECT "Clustered"
SELECT "DB Space"
SELECT "Fill Factor"
SELECT "FillfFactor"
Example of using identifiers with the SELECT command
The following example shows how the text identifier can be used in a SELECT command.
The example produces a report having three columns. The first column contains the name of the Relation Line (as specified by the WHERE command statement). The second and third columns list the cardinality at the beginning and end of the line. The cardinality is specified as Unmarked, Only One, Zero or One, One or Many, Zero, One or Many, Supertype, Subtype, or Unknown.
SELECT Name, "From Association", " To Association"
WHERE Class = Symbol
WHERE Type = Relation
See also From association field and To association field.
Parent topic
Reporting system command language