.Delimid Statement--Enable Recognition of Delimited Identifiers
The .delimid statement allows recognition of delimited identifiers for table, view, column, schema, and user names.
The .delimid statements has the following format:
.delimid
Description
Specify the .delimid statement in the Report-Writer source file to enable Report-Writer to recognize delimited identifiers in your report specification code. For a detailed discussion of delimited identifiers, see the chapter “Report-Writer Expressions and Formats.”
You only need to specify this statement once in the source file. However, Report-Writer accepts multiple occurrences in a report specification to support use of the statement in individual and independent .include files for which delimited identifiers must be enabled.
Note: If you use the .delimid statement in an .include file, be sure the included file actually contains code that requires this statement. Otherwise, Report-Writer can produce unexpected results.
Observe the following rules regarding placement of this statement in your report specification:
• The .delimid statement must precede any statement that allows delimited identifiers. Therefore, only the following statements can precede the .delimid statement:
– .name
– .shortremark
– .longremark ... .endremark
– .[no]formfeeds
– .nullstring
– .output
– .ulcharacter
The .include statement cannot precede the .delimid statement because the included file can contain statements that allow delimited identifiers.
• If your report specification contains a .query statement specifying QUEL as the query language.
Example
The following example shows use of the .delimid statement in a report specification that creates a temporary table with columns “aaaa” and “delim col,” then selects and prints values from column “aaaa” that match the value entered in response to a prompt for the variable “my_smallint.”
.name sql_setup
.delimid
.declare my_smallint = smallint with prompt 'Enter
selection key numeric value: '
.setup
create table my_temp_table (aaaa smallint,
"delim col" varchar(4));
insert into my_temp_table values (123,'abcd');
.query
select aaaa from my_temp_table where aaaa =
'$my_smallint'
.detail
.println 'Key Value: ',aaaa
.cleanup
drop table my_temp_table;
.Delimid with QUEL Query
Delimited identifiers cannot be used in a QUEL query. However, you can use delimited identifiers and the .delimid statement in non‑query portions of a report specification that contains a QUEL query, as shown in the following example.
This example creates a temporary table with columns “aaaa” and “delim col,” then retrieves and prints values from column “aaaa” that match the value entered in response to a prompt for the variable “my_smallint.”
.name sql_setup
.delimid
.declare my_smallint = smallint with prompt 'Enter
selection key numeric value: '
.setup
create table my_temp_table (aaaa smallint,
"delim col" varchar(4));
insert into my_temp_table values (123, 'abcd');
.query
range of mtt is my_temp_table
retrieve (mtt.aaaa, quote = "\"")
where mtt.aaaa = "$my_smallint"
.detail
.println 'Key Value: ',aaaa
.cleanup
drop table my_temp_table;
create table my_temp_table (aaaa smallint,
"delim col" varchar(4));
insert into my_temp_table values (123, 'abcd');
drop table my_temp_table;
Last modified date: 04/03/2024