HP c-tree-SQL ISQL and Tools manual Help and Table Statements, Transaction Support

Page 37

ISQL Statements

End of Orders Summary Report

23 records selected ISQL>

3.5THE HELP AND TABLE STATEMENTS

ISQL supports an on-line help facility that can be invoked by using the HELP statement. Typ- ing HELP at the ISQL prompt will display a help file which will list the options accepted by the HELP statement. The various forms of the HELP statement are listed below:

HELP - Displays the options that can be specified for HELP.

HELP COMMANDS - Displays all the statements that ISQL accepts.

HELP command_name - Displays help file corresponding to the specified statement.

TABLE is an ISQL statement that displays all the tables present in the database including any system tables. TABLE can be used also to display the description of a single table by explicitly giving the table name. Both forms of the TABLE statement are shown below:

TABLE;

TABLE table_name;

3.6TRANSACTION SUPPORT

A transaction is started with the execution of the first SQL statement. A transaction is commit- ted using the COMMIT WORK statement and rolled back using the ROLLBACK WORK statement.

If the AUTOCOMMIT option is set to ON, then ISQL treats each SQL statement as a single transaction. This prevents the user from holding locks on the database for an extended period of time. This is very critical when the user is querying an on-line database in which a transac- tion processing application is executing in real time.

A set of SQL statements can be executed as part of a transaction and committed using the COMMIT WORK statement. This is shown below:

<SQL statement>

<SQL statement>

<SQL statement>

COMMIT WORK ;

Instead, a transaction can also be rolled back using the ROLLBACK WORK statement as shown:

<SQL statement>

<SQL statement>

FairCom Corporation

3-11

Image 37
Contents For use with c-treeSQL Server Isql and Tools Reference GuidePage Table of Contents Data Load Utility dbload Iii Tutorial Source CodeFairCom Corporation Documentation Overview Syntax Diagram ConventionsPurpose of this Manual AudienceIsql and Tools Related DocumentationOverview IntroductionIsql and Tools FairCom Corporation Introductory Tutorial Quick TourInit IsqlManage DefineIsql Create Table Custmast Isql Commit Work 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 Starting Interactive SQL Isql StatementsSyntax ArgumentsStatement History Support PasswordUsername ConnectstringIsql Statements Formatting Output of Isql QueriesIsql Statements for Statement History Support Statement SummaryDisplay 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 Statements1 @ Execute Syntax Isql ReferenceDescription ExampleBreakspec Break SyntaxSkip n ExamplesCustomername History Clear SyntaxColumn Syntax ArgumentOption Break Column Compute Display TitleFormat formatstring ColumnnameHeading headingtext Character Description Date-Time Format Strings for the Column StatementNot Null INT Null ? Type Length ColnameChar Amount OrderinfoSysdate Column Title FLDNEW Title ComputeVariablename AVG MAX MIN SUM CountValue Define SyntaxDisplayvalue ColpositionCOL columnnumber @columnnameEdit Syntax Related Statements Exit or Quit SyntaxExit Isql GET query.sql 10 GET SyntaxIsql RUN Help Syntax Help CommandsclausesHistory Syntax Orderstate LotlocationFollowing example illustrates usage of the History statement Host or SH or Syntax HostcommandFrom List Syntax 16 RUN Syntax Quit or Exit SyntaxQuit Isql History18 SET Syntax Save SyntaxPagesize LinesizePagesize numberlines Transaction Isolation Level isolationlevel Connection databasename DefaultIsql Break on Isql Select TBL from Systables TBL TBLShow Syntax Spool Syntax Is Default ?Filename on Database ConnectionsArgument … Start SyntaxIsql Spool STK on Isql Spool OFFNot Null Varchar Null ? Type Length Colname Not Null INTType Length Colname Null ? TablenameDate Left Center Right COL n Title SyntaxText DoubleIsql Clear Title Isql and Tools FairCom Corporation Introduction Data Load Utility dbloadCommandsfile Dbload Command Line SyntaxPrerequisites for Dbload OptionsData Load Utility dbload Data File FormatsVariable Length Records Commands FileFixed Length Records Next RecordChar 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 Outfile Username.procedurenameUsername.tablename Username.triggernameDbschema Schema Export Utility dbschemaImport Begin ENDIsql 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