15. Creating Reports in OpenROAD : Report Design Techniques : Create Tabular Reports : How You Can Use Global Temporary Tables and Variable Table Names
 
Share this page                  
How You Can Use Global Temporary Tables and Variable Table Names
Reporter supports the use of global temporary tables and variable table names, which may be passed as parameters to the report. This is achieved through the use of example tables. An example table must exist in the design environment while the report is being specified but need not be kept after report definition is complete. An example table is required to contain only runtime-compatible column definitions that are required by the report. To set an example table, a table must be selected in the Query Definition pane.
A table that takes part in a query may be one of three example types:
Self
Specifies a runtime table of the same name. This may include a schema.
Temporary
Specifies a global temporary table that may already exist in the session that calls the report (in which case the same database session must be used by the report), or may be created during the setup phase of the report.
Reporter will automatically refer to the table as session.tablename. These tables may be created at runtime by the caller in the same session that the report will be run or may be created as part of Report/Setup using the OpenROAD syntax for declare global temporary table.
To drop a temporary table explicitly, use drop 'session.tablename'.
Parameter
Specifies tablename as a report variable that must be initialized at runtime. The table name passed in may be that of a temporary table. It may have a default value.
When a table is specified as a parameter you will be prompted to create a variable through the Variables List dialog (see Create a Variable Field (see Create a Variable Field)). Variables that are associated with tables are always of type varchar and are report parameters.
Notes:
A temporary table may be a parameter. In this case define the example type as Parameter and pass the table name as session.tablename.
Parameter tables may not have a schema attached within the Query Editor. If required, pass the schema as part of the tablename.
In the graphical display area of the Query Editor, tables that are examples of temporary tables are prefixed with (T), and parameter examples with (P).
Quotes ('') are required around the table name for the drop statement.
When the example type is parameter, this option is available to view or edit the associated parameter variable.