HP c-tree-SQL ISQL and Tools manual Colposition, Displayvalue, COL columnnumber, @columnname

Page 50

ISQL and Tools

Issuing the DISPLAY statement without any arguments displays the currently-set DISPLAY specifications, if any.

Arguments

col_position

An optional argument that specifies the horizontal positioning of the associated display value. There are two forms for the argument:

COL column_number

Directly specifies the column position of the display value as an

 

integer(1 specifies column 1, 2 specifies column 2, and so on.).

@column_name

Names a column in the select list of the SQL query. ISQL aligns

 

the display value with the specified column.

If the DISPLAY statement omits col_position, ISQL positions the display value at column 1.

display_value

The value to display when the associated break occurs:

"text string"

If the display value is a text string, ISQL simply displays the text string.

variable

If the display value is a variable, ISQL displays the value of the variable

 

when the associated break occurs. The variable argument refers to a vari-

 

able named in a COMPUTE or DEFINE statement that executes before

 

the query. If variable is undefined, ISQL ignores it.

column_name

If the display value is a column name, ISQL displays the value of the col-

 

umn when the associated break occurs. The column specified in

 

column_name must also be included in the select list of the query. If

 

column_name is not also included in the select list, it has no effect. If a

 

COLUMN statement specifies a format for the same column, the format-

 

ting also affects the DISPLAY statement.

break_spec

Specifies the set of rows after which ISQL processes the DISPLAY statement. A DISPLAY statement has no effect until you issue a corresponding BREAK statement. See the description of the BREAK statement in Section 3.7.2 "BREAK" on page 3-13 for details of break specifi- cations.

Examples

The following set of examples compute the number of orders placed by each customer and dis- plays the message Number of orders placed by, followed by the customer name and the count of orders.

ISQL> break on customer_name

3-24

FairCom Corporation

Image 50
Contents Isql and Tools Reference Guide For use with c-treeSQL ServerPage Table of Contents Data Load Utility dbload Tutorial Source Code IiiFairCom Corporation Purpose of this Manual Syntax Diagram ConventionsDocumentation Overview AudienceRelated Documentation Isql and ToolsIntroduction OverviewIsql and Tools FairCom Corporation Init Quick TourIntroductory Tutorial IsqlIsql Create Table Custmast DefineManage Isql Commit Work CustmastQuick Tour DoneComplete Introductory Tutorial Code Relational Model and Indexing Tutorial ISQLTutorial2.sqlQuick Tour Values Insert IntoValues Insert Into Commit Work QTY PriceComplete Relational Model and Indexing Tutorial Source Code Locking Tutorial ISQLTutorial3.sql@ISQL @iSQLTutorial3.sql Isql Delete from Custmast Complete Locking Tutorial Source Code Transaction Processing Tutorial ISQLTutorial4.sqlTransaction Rollback Work Complete Transaction Processing Tutorial Source Code Syntax Isql StatementsStarting Interactive SQL ArgumentsUsername PasswordStatement History Support ConnectstringIsql Statements for Statement History Support Formatting Output of Isql QueriesIsql Statements Statement SummaryIsql Statements for Query Formatting Summary DisplayExample 3-1 Unformatted Query Display from Isql Customername Customercity Orderid OrdervalueFormatting Column Display with the Column Statement Example 3-2 Controlling Display Width of Character ColumnsCustomername Customercity Example 3-3 Customizing Format of Numeric Column DisplaysOrdervalue Example 3-4 Specifying Column Breaks and Values with Display Numorders Customername Example 3-6 Specifying a Query Header and Footer with Title Help and Table Statements Transaction SupportDescription Isql Reference1 @ Execute Syntax ExampleBreak Syntax BreakspecCustomername ExamplesSkip n Clear Syntax HistoryOption ArgumentColumn Syntax Break Column Compute Display TitleHeading headingtext ColumnnameFormat formatstring Date-Time Format Strings for the Column Statement Character DescriptionChar Null ? Type Length ColnameNot Null INT Sysdate OrderinfoAmount NEW Title FLDColumn Title ComputeAVG MAX MIN SUM Count VariablenameDefine Syntax ValueCOL columnnumber ColpositionDisplayvalue @columnnameEdit Syntax Exit Exit or Quit SyntaxRelated Statements 10 GET Syntax Isql GET query.sqlIsql RUN History Syntax Help CommandsclausesHelp Syntax Orderstate LotlocationFollowing example illustrates usage of the History statement From HostcommandHost or SH or Syntax List Syntax Quit Quit or Exit Syntax16 RUN Syntax Isql HistoryPagesize Save Syntax18 SET Syntax LinesizePagesize numberlines Isql Break on Isql Select TBL from Systables TBL Connection databasename DefaultTransaction Isolation Level isolationlevel TBLShow Syntax Filename on Is Default ?Spool Syntax Database ConnectionsIsql Spool STK on Start SyntaxArgument … Isql Spool OFFNull ? Type Length Colname Not Null INT Not Null VarcharDate TablenameType Length Colname Null ? Text Title SyntaxLeft Center Right COL n DoubleIsql Clear Title Isql and Tools FairCom Corporation Data Load Utility dbload IntroductionPrerequisites for Dbload Dbload Command Line SyntaxCommandsfile OptionsData File Formats Data Load Utility dbloadFixed Length Records Commands FileVariable Length Records Next RecordDefine Record Statement Char Short Long Float DoubleFor Each Statement NullExample 4-1 Sample dbload commands files ExamplesPosition not specified for fixed length record Compilation ErrorsRecord name redefined Fatal Errors Isql and Tools FairCom Corporation Data Unload Utility dbdump Prerequisites for DbdumpDbdump Command Line Syntax Data Unload Utility dbdump Short Long Float DoubleFor Record Statement Define Record custrec of Fixed Length 37 AS Isql and Tools FairCom Corporation Schema Export Utility dbschema Username.tablename Username.procedurenameOutfile Username.triggernameImport Begin Schema Export Utility dbschemaDbschema ENDIsql and Tools FairCom Corporation Tutorial Source Code Commit Work Select * from Custmast Delete from CustmastVARCHAR6 IntegerMoney Tutorial Source Code Commit Work Delete from CustmastImdesc VARCHAR48 Select * from orderlist Select * from orderitems Isql and Tools FairCom Corporation Symbols Index-iIsql Index-ii FairCom CorporationIndex Index-iii FairCom Corporation