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

Page 43

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

Image 43
Contents For use with c-treeSQL Server Isql and Tools Reference GuidePage Table of Contents Data Load Utility dbload Iii Tutorial Source CodeFairCom Corporation Audience Syntax Diagram ConventionsDocumentation Overview Purpose of this ManualIsql and Tools Related DocumentationOverview IntroductionIsql and Tools FairCom Corporation Isql Quick TourIntroductory Tutorial InitIsql Commit Work Custmast DefineManage Isql Create Table CustmastComplete Introductory Tutorial Code DoneQuick Tour ISQLTutorial2.sql Relational Model and Indexing TutorialQuick Tour Values Insert Into Insert IntoValues QTY Price Commit WorkComplete Relational Model and Indexing Tutorial Source Code ISQLTutorial3.sql Locking Tutorial@ISQL @iSQLTutorial3.sql Isql Delete from Custmast Complete Locking Tutorial Source Code ISQLTutorial4.sql Transaction Processing TutorialTransaction Rollback Work Complete Transaction Processing Tutorial Source Code Arguments Isql StatementsStarting Interactive SQL SyntaxConnectstring PasswordStatement History Support UsernameStatement Summary Formatting Output of Isql QueriesIsql Statements Isql Statements for Statement History SupportDisplay Isql Statements for Query Formatting SummaryCustomername Customercity Orderid Ordervalue Example 3-1 Unformatted Query Display from IsqlExample 3-2 Controlling Display Width of Character Columns Formatting Column Display with the Column StatementOrdervalue Example 3-3 Customizing Format of Numeric Column DisplaysCustomername Customercity Example 3-4 Specifying Column Breaks and Values with Display Numorders Customername Example 3-6 Specifying a Query Header and Footer with Title Transaction Support Help and Table StatementsExample Isql Reference1 @ Execute Syntax DescriptionBreakspec Break SyntaxSkip n ExamplesCustomername History Clear SyntaxBreak Column Compute Display Title ArgumentColumn Syntax OptionFormat formatstring ColumnnameHeading headingtext Character Description Date-Time Format Strings for the Column StatementNot Null INT Null ? Type Length ColnameChar Amount OrderinfoSysdate Compute FLDColumn Title NEW TitleVariablename AVG MAX MIN SUM CountValue Define Syntax@columnname ColpositionDisplayvalue COL columnnumberEdit Syntax Related Statements Exit or Quit SyntaxExit Isql GET query.sql 10 GET SyntaxIsql RUN Orderstate Lotlocation Help CommandsclausesHelp Syntax History SyntaxFollowing example illustrates usage of the History statement Host or SH or Syntax HostcommandFrom List Syntax Isql History Quit or Exit Syntax16 RUN Syntax QuitLinesize Save Syntax18 SET Syntax PagesizePagesize numberlines TBL Connection databasename DefaultTransaction Isolation Level isolationlevel Isql Break on Isql Select TBL from Systables TBLShow Syntax Database Connections Is Default ?Spool Syntax Filename onIsql Spool OFF Start SyntaxArgument … Isql Spool STK onNot Null Varchar Null ? Type Length Colname Not Null INTType Length Colname Null ? TablenameDate Double Title SyntaxLeft Center Right COL n TextIsql Clear Title Isql and Tools FairCom Corporation Introduction Data Load Utility dbloadOptions Dbload Command Line SyntaxCommandsfile Prerequisites for DbloadData Load Utility dbload Data File FormatsNext Record Commands FileVariable Length Records Fixed Length RecordsChar Short Long Float Double Define Record StatementNull For Each StatementExamples Example 4-1 Sample dbload commands filesRecord name redefined Compilation ErrorsPosition not specified for fixed length record Fatal Errors Isql and Tools FairCom Corporation Prerequisites for Dbdump Data Unload Utility dbdumpDbdump Command Line Syntax Short Long Float Double Data Unload Utility dbdumpFor Record Statement Define Record custrec of Fixed Length 37 AS Isql and Tools FairCom Corporation Schema Export Utility dbschema Username.triggername Username.procedurenameOutfile Username.tablenameEND Schema Export Utility dbschemaDbschema Import BeginIsql and Tools FairCom Corporation Commit Work Select * from Custmast Delete from Custmast Tutorial Source CodeMoney IntegerVARCHAR6 Commit Work Delete from Custmast Tutorial Source CodeImdesc VARCHAR48 Select * from orderlist Select * from orderitems Isql and Tools FairCom Corporation Index-i SymbolsIndex-ii FairCom Corporation IsqlIndex-iii FairCom Corporation Index