17. System Commands for the Forms-based Tools : report Command--Run a Report : How the Report Command Works
 
Share this page                  
How the Report Command Works
When you type the report command at the operating system prompt, the following actions occur:
1. Report-Writer checks the report system catalogs to see if a report of the given name is stored in the database. If one is found, it reads the specifications for the report and checks for errors. If errors occur, it does not run the report. If no report with the given name is found, the name is assumed to be a table name, view name, or synonym referring to a table. Report-Writer formats a default report for the specified table and executes it. (See the “Using Ingres Report-Writer” chapter for more information on default reports.) If no table or report with the given name is found, an error message appears on the screen.
2. If the specification is error-free, Report-Writer replaces variables for the setup and layout statements with their specified values. Then it runs the .query statement in your report specification (if specified) and extracts the report data.
3. Finally, Report-Writer sorts the report data, if required, and formats and outputs the report. If no report with the given name is found, the name is assumed to be a table name. Report-Writer formats a default report for the specified table and runs it. If no table or report with the given name is found, an error message appears on the screen.
4. If any column in the table on which the report is based is of an unsupported data type, such as long varchar, byte, byte varying, and long byte, Report-Writer ignores and does not print that column when printing the report.
Note:  If Report-Writer encounters subsequent references to a column of an unsupported data type, such as in sort operations, it issues an error message and terminates the report.
The -r and -m flags are especially useful if you have reports and tables with the same name and need to be more specific about which you want. Use the -r flag to force Report-Writer to only check for reports with the name you specify. Use the -m flag to force Report-Writer to only check for tables with the name you specify.
Additionally, you can use the -m flag to specify the style of default report to be produced. For more information on these styles, see the "Using Report-Writer” chapter.