Was this helpful?
.Data Statement--Specify Table for Report
The .data statement specifies the table or view in the database containing data for the report.
The .data statement has the following format:
.data | .dat | .table | .view [schema.]tablename|viewname|synonym
The parameters for the .data statement are as follows:
schema
Collection of database objects to which the specified object belongs. The schema also implies the user that owns the object.
The schema can be expressed as a variable or delimited identifier.
tablename | viewname | synonym
Name of a table or view in the database. You can also use a synonym for tablename. Report-Writer reads all rows and columns in the specified table or view each time the report is run. Rules for the use of tablename and viewname are the same as in all other Ingres tools.
The tablename, viewname, and synonym can be expressed as variables or delimited identifiers.
$tablevariable
Variable whose value is the name of a table, view, or synonym for a table in the database. The variable must be preceded with a dollar sign ($).
Description
Note:  The .data statement identifies a table or view in the database that is used in its entirety in the report. The four statement names shown in the syntax are synonymous and can be used interchangeably. Each time you run a report with the report command, all of the rows and columns in the table or view are available for use in the report specification. One exception to this is that Report-Writer silently ignores and does not print values for columns with unsupported data types such as long varchar, byte, byte varying, and long byte.
Note:  If Report-Writer encounters subsequent references to a column of an unsupported data type, such as within sort operations, it issues an error message and terminates the report.
You can use a delimited identifier (see Delimited Identifiers) for tablename if you have previously specified the .delimid statement.
If you specify a variable as the table, Report-Writer evaluates tablename during the loading of the report specification, before retrieving the data.
An SQL language report specification includes duplicate rows in the data for reports that use the .data, .table, or .view statements. To specify distinct rows, you can specify the ‑6 flag on the report command line.
Either the .data or the .query statement is a required statement for each report. The .data and .query statements are mutually exclusive; both cannot appear in the same report specification.
Examples
1. Use table “repdat” for the report.
.data repdat
2. Use view “myview” for the report.
.table myview
3. Use the value of variable rep_table as the table for the report.
.data $rep_table
4. For the report, use the table whose name is the delimited identifier “my table” and whose schema is “robert.”
.data robert."my table"
Last modified date: 08/14/2024