|Oracle® OLAP DML Reference
11g Release 2 (11.2)
|PDF · Mobi · ePub|
The SHOW command shows a single value of an expression. Normally, you would use SHOW to show the value of a single-cell variable or to show a message. SHOW is useful in programs when you want to generate an error-like message without creating an error condition. The output from SHOW is sent to the current outfile.
The value you want to show. When expression is dimensioned, only the first value of the expression is shown, based on the current status of its dimensions. When you are showing a text literal, you must enclose the value in single quotes.
Indicates that a new line sequence should not be appended to the end of the value. By default, SHOW appends a new line sequence.
The NONL argument to SHOW is useful in programs. Using this argument you can concatenate several values into a single line of output. To accomplish this, include one or more SHOW commands with the NONL argument, followed by a single SHOW statement without the NONL argument. The values from all the SHOW commands are concatenated into a single output value, in the order specified. Depending on the length of the line, this value might actually produce multiple lines of output.
SHOW can be used as an alternative to SIGNAL when you want to generate an error message from a program. Unlike SIGNAL, SHOW produces a message without signaling an error condition and thus halting execution of the program. Your error message may be most useful when you send it to a debugging file. When you use a DBGOUTFILE statement to direct messages to a debugging file, the output from SHOW is sent to the debugging file and to your current outfile.
When SHOW is used with a named or unnamed composite, an
NA value is shown when the composite does not have a value that corresponds to the first values in the status for its base dimensions. For example, the statement
SHOW SPARSE <market product>
NA value when the combination of the current values of
product does not exist in the composite.
To break a text expression into two or more lines of output text, insert newline delimiters (\n) at the appropriate places in the text.
The SHOW command converts NTEXT values to the character set of the outfile. When an NTEXT value cannot be represented in the outfile character set, the character is not displayed correctly.
This example uses SHOW to report the current value of the DECIMALS option. The OLAP DML statement
produces the following output.
When you use SHOW to report the value of a dimensioned variable, only the first value of the variable, based on the current status of its dimensions, is shown. The OLAP DML statement
SHOW JOINCHARS('Actual = ' actual)
produces the following output.
Actual = 533,362,88
When you want to produce a warning message without branching to an error label, then you can use a
select: LIMIT month TO nummonths IF STATLEN(month) GT 9 THEN DO SHOW 'You can select no more than 9 months.' GOTO finish DOEND REPORT DOWN district W 6 units finish: POP month RETURN