Command Reference Guide > Command Reference Guide > Using Ingres Commands > report Command--Run a Report on a Table
Was this helpful?
report Command--Run a Report on a Table
The report command runs a report for a table in the database. The command creates either a default report or a report set up by the rbf or sreport command.
For a complete description of Ingres reporting tools, see the Character-based Querying and Reporting Tools User Guide.
The report command has the following format:
report dbname |vnode::dbname[/server_class] [-r|-m [style]] report_target
(variable=value {,variable=value})] [-foutputfile] [-oprinter] [-ncopies] [-5]
[-6] [+b|-b] [-d] [-h] [-lpagewidth] [-qmxquer] [+t|-t] [-vpagelength] [-wmxwrap]
[-ifilename] [-s] [-uusername] [-Ggroupid] [-numeric_overflow=fail|ignore|warn]
dbname
Identifies the name of the database containing the report data, and if required, the vnode and server_class, as described in Standard Flags and Parameters.
-r
Indicates that a report is specified as the report_target. If the specified report is not found, an error message is returned.
-m[style]
Indicates that a table is specified as the report_target. This instructs report to format a default report for the specified table.
The optional style specifies the style of your report. Accepted values are wrap, tabular (same as column), block, labels, and indented. If you do not specify a style, report selects either tabular or block, depending on the width of your report. Tabular is used if all of the columns fit on one page; otherwise, block is selected. The default report width is 132 characters.
report_target
Specifies the name of the object on which you wish to run the report. The report_target can be:
An existing report, created using RBF or sreport.
A table, view, or synonym in your database on which you want a default report formatted.
The table, view, or synonym name can be qualified with a valid schema name in the format schema.name, as described in Schema Qualifier--Specify Ownership.
You can specify the type of report_target by using the –r or –m flag. If neither flag is specified, the report command looks first for a report having the specified name. If a report is not found, but a table with the same name exists, report sets up a default report for that table.
variable=value
Specifies the name of a parameter (variable) used in the report, and the value that is replaced for every occurrence of the corresponding variable name in the report specifications. If you want to specify a string or a date, value must be quoted. You can separate variable and value combinations using blanks, tabs, or commas.
-foutputfile
Directs the formatted report to the outputfile. If this option is not specified, the report is written to the standard output file (normally your terminal), or, in the case of a report specified by the Report Writer, to the file designated by the .output command in the report specification file.
-noutf8align
Turns off the default formatting for UTF8 installations, which allows reports containing multibyte UTF-8 characters to be formatting for display on a UTF8 enabled terminal. This option is the same as II_PRINT_UT8ALIGN=OFF.
-oprinter
Sends the report to the specified printer.
To set a default printer, define ING_PRINT. If you require special print options, specify the options in ING_PRINT, and specify the –o flag with no argument.
-ncopies
Specifies the number of copies of the report to print.
-5
Forces version 5 compatibility mode, as follows:
The +t option is the default for aggregates.
All arithmetic is floating-point, unless all values in the computation are integers.
By default, the month portion of the current_date() function is displayed in uppercase letters.
-6
(SQL reports only) Eliminates duplicate rows from reports whose specification contains .data, .table, .view, or .sort statements.
-b|+b
Forces (+b) or suppresses (-b) form feed at the end of each page. The flag overrides .formfeeds or .noformfeeds commands in the report specification file.
-d
Directs report to continue running the specified report if the .setup or .cleanup statements generate DBMS errors.
-h
Provides a null set of data for a report that retrieves no rows. All .header and .footer sections are executed. The detail section is suppressed. This feature allows you to include the following .if statement in the report footer to indicate that no rows were found:
if count(column) = 0 .then
  .print
  “No data matched the
   query specifications.”
.endif
-lpagewidth
Sets the maximum output line size to pagewidth characters. By default, if output is to a file, the maximum output line size is 132 characters; otherwise, the default maximum line size is the width of the terminal.
-qmxquery
Sets the maximum length of the query after all substitutions for runtime parameters have been made to mxquery characters. By default, the maximum query size is 2048 characters. This option is needed for long queries only.
-t|+t
Causes aggregates and breaks to use underlying values (-t) or rounded values (+t) for any floating-point column whose format has been specified in a .format command as numeric F or template. If +t is specified, each value in the column is rounded to the precision given by its format, and breaks for date columns that use a date template occur over the actual value appearing for the dates.
Default: –t
-vpagelength
Sets the number of lines for each page of output. The pagelength must be a positive integer. This flag overrides any .pagelength command in the report specification file.
Default: 61 lines per page if the report is written to a file; 23 lines per page if written to a terminal.
-wmxwrap
Specifies the maximum number of lines to wrap (mxwrap) with one of the column C formats, or the maximum number of lines that can be used in any block.
Default: 300. This maximum is provided as a protection against misspecified columns and is rarely needed.
-ifilename
Reads a report specification from the specified file outside of the database, and runs the report. Using this flag eliminates the need to use the sreport command to place the report source file in the database for processing.
When using this flag, you must omit report_target and the –r|-m flag.
-s
Suppresses status messages.
-uusername
Specifies the effective user for the session, as described in Standard Flags and Parameters.
-Ggroupid
Specifies a group identifier, as described in Standard Flags and Parameters.
On VMS, enclose this parameter in double quotation marks (“-Ggroupid”).
-numeric_overflow=fail | ignore | warn
Sets error-handling mode for numeric overflow.
fail
(Default) Causes an error message to be issued and the statement is aborted. To obtain ANSI-compliant behavior, use this setting (or omit for the default).
ignore
Causes no error message to be issued.
warn
Causes a warning message to be issued.
Last modified date: 08/29/2024