ISQL Statements

Description

The COLUMN statement controls how ISQL displays a column's values (the FORMAT clause) and specifies alternative column-heading text (the HEADING clause).

The COLUMN statement without any arguments displays the current column specifications.

Arguments

column_name

The name of the column affected by the COLUMN statement. If the COLUMN statement includes column_name but omits both the FORMAT and HEADING clauses, ISQL clears any formatting and headings in effect for that column. The formatting specified for column_name also applies to DISPLAY statements that specify the same column.

FORMAT " format_string "

Specifies a quoted string that formats the display of column values. Valid values for format strings depend on the data type of the column.

Character

The only valid format string for character data types is of the form "An",

 

where n specifies the width of the column display. The A character must

 

be upper case.

Numeric

Table 3-3: Numeric Format Strings for the COLUMN Statement on page

 

3-18 shows valid format strings for numeric data types.

Date-time

Table 3-4:Date-Time Format Strings for the COLUMN Statement on

 

page 3-18 shows valid format strings for date-time data types. The for-

 

mat strings consist of keywords that SQL interprets and replaces with

 

formatted values. Any other character in the format string are displayed

 

as literals. The format strings are case sensitive. For instance, SQL

 

replaces 'DAY' with all uppercase letters, but follows the case of 'Day'.

 

Note that the SQL scalar function TO_CHAR offers comparable func-

 

tionality and is not limited to SQL statements issued within ISQL. See

 

the c-treeSQL Reference Manual for details on TO_CHAR.

COLUMN format strings also affect display values in DISPLAY statements that specify the same column or a COMPUTE value based on the column.

HEADING " heading_text "

Specifies an alternative heading for the column display. The default is the column name.

FairCom Corporation

3-17

Page 43
Image 43
HP c-tree-SQL ISQL and Tools manual Columnname, Format formatstring, Heading headingtext