HP c-tree-SQL ISQL and Tool reference Guide - Manuals
HP c-tree-SQL ISQL and Tool reference Guide – Manual in PDF format online.
Manuals:
Manual HP c-tree-SQL ISQL and Tool reference Guide
Summary
FairCom Corporation i Table of Contents Documentation Overview Purpose of This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vAudience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
ii FairCom Corporation 3.5 The HELP and TABLE Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-113.6 Transaction Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-113.7 ISQL Reference . . . . ...
FairCom Corporation iii 5.4 Data File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25.5 The Commands File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5.5.1 The...
FairCom Corporation v Documentation Overview PURPOSE OF THIS MANUAL This manual provides reference material for the ISQL interactive SQL utility as well as the dbload , dbdump , and dbschema administrative tools provided in the c-treeSQL environment. It also includes a tutorial describing how to use...
ISQL and Tools vi FairCom Corporation RELATED DOCUMENTATION Refer to the following documents for more information: lowercase Lowercase type denotes either user-supplied elements or names of other syntax diagrams. User-supplied elements include names of tables, host-language variables, expressions, a...
FairCom Corporation 1-1 Chapter 1 Introduction 1.1 OVERVIEW Interactive SQL (often referred to throughout this manual as ISQL) is a utility supplied with c-treeSQL that lets you issue SQL statements directly from a terminal and see results displayed at the terminal. You can use interactive SQL to: •...
FairCom Corporation 2-1 Chapter 2 Quick Tour 2.1 INTRODUCTORY TUTORIAL iSQL_Tutorial1.sql This introductory tutorial will rapidly take you through the basic use of the powerful interactive SQL (iSQL) database interface. iSQL is a full featured command line client side query tool useful for submittin...
ISQL and Tools 2-2 FairCom Corporation 2.1.2 Define In this case define consists of the CREATE TABLE statement. This is done in a single iSQL statement in which specific fields are defined. Upon successful creation of the table, the changes made to the database by this transaction are made permanent...
Quick Tour FairCom Corporation 2-3 VALUES ('1001', '61434', 'CT', '1', 'Michael Jordan', '13 Main', 'Harford'); ISQL> INSERT INTO CUSTMAST VALUES ('1002', '73677', 'GA', '1', 'Joshua Brown', '4356 Cambridge', 'Atlanta'); ISQL> INSERT INTO CUSTMAST VALUES ('1003', '10034', 'MO', '1', 'Keyon Doo...
ISQL and Tools 2-4 FairCom Corporation 2.2 RELATIONAL MODEL AND INDEXING TUTORIAL iSQL_Tutorial2.sql This intermediate tutorial will advance the concepts introduced in the first tutorial by expanding the number of tables and building a relational model. This tutorial will walk you through defining a...
Quick Tour FairCom Corporation 2-5 OrderList - A table of records consisting of a list of orders. OrderItem - A table of records consisting of specific items associated with an order. ItemMaster - A table of records consisting of information about items. CustomerMaster - A table of records consistin...
ISQL and Tools 2-6 FairCom Corporation ISQL> CREATE INDEX itemnum ON itemmast (im_itemnum); ISQL> CREATE TABLE custmast ( cm_custnum VARCHAR(5), cm_zip VARCHAR(10), cm_state VARCHAR(3), cm_rating VARCHAR(2), cm_name VARCHAR(48), cm_address VARCHAR(48), cm_city VARCHAR(48)); ISQL> CREATE IND...
Quick Tour FairCom Corporation 2-7 INSERT INTO custmast VALUES ('1000', '92867', 'CA', '1', 'Bryan Williams', '2999 Regency', 'Orange'); INSERT INTO custmast VALUES ('1001', '61434', 'CT', '1', 'Michael Jordan', '13 Main', 'Harford'); INSERT INTO custmast VALUES ('1002', '73677', 'GA', '1', 'Joshua ...
Quick Tour FairCom Corporation 2-9 2.3 LOCKING TUTORIAL iSQL_Tutorial3.sql This tutorial will introduce the concept of locking. The function-ality for this tutorial focuses on adding records, then updating a single record to the customer master table. From the iSQL utility the script will be parsed ...
ISQL and Tools 2-10 FairCom Corporation 2.3.2 Define In this case define consists of the CREATE TABLE statement. This is done in a single iSQL statement in which specific fields are defined. Upon successful creation of the table, the changes made to the database by this transaction are made permanen...
Quick Tour FairCom Corporation 2-11 The first process has the record associated with customer number 1003 locked. Meanwhile the second process has attempted to delete the contents of the customer master table and has been blocked when attempting to lock the table. At this point both processes are ef...
ISQL and Tools 2-12 FairCom Corporation 2.3.5 Complete Locking Tutorial Source Code Complete source code for the locking tutorial can be found in Appendix A "Tutorial Source Code" .
Quick Tour FairCom Corporation 2-13 2.4 TRANSACTION PROCESSING TUTORIAL iSQL_Tutorial4.sql This tutorial will introduce the concept of transaction processing, based on the relational model of the previous tutorial. Records will be added to tables orderlist and orderitems as a single transac-tion. Tr...
ISQL and Tools 2-14 FairCom Corporation Transaction These tables consist of a Customer Master table and an Item Master table that support prima-rily static information regarding a company's product line and customer demographics. The orderlist and orderitems tables consist of dynamic information per...
FairCom Corporation 3-1 Chapter 3 ISQL Statements 3.1 OVERVIEW This chapter describes only those statements that are specific to ISQL. See the c-treeSQL Ref- erence Guide for detailed reference information on standard SQL statements that can be issued in other environments. 3.2 STARTING INTERACTIVE ...
ISQL and Tools 3-2 FairCom Corporation The file name must be enclosed in doubles quotes, such as:isql -s "test script.sql" testdb -u user_name The user name c-treeSQL uses to connect to the database specified in the connect_string . c- treeSQL verifies the user name against a corresponding p...
ISQL Statements FairCom Corporation 3-3 3.4 FORMATTING OUTPUT OF ISQL QUERIES Formatting of database query results makes the output of a database query more presentable and understandable. The formatted output of an ISQL database query can be either displayed on the screen, written to a file, or spo...
ISQL and Tools 3-4 FairCom Corporation ISQL includes several statements that provide simple formatting of SQL queries. The follow-ing table summarizes the ISQL query-formatting statements. The rest of this section provides an extended example that illustrates how to use the statements together to im...
ISQL Statements FairCom Corporation 3-5 All the examples use the same ISQL query. The query retrieves data on outstanding customer orders. The query joins two tables, customers and orders . The examples for the TABLE state- ment on Section 3.7.13 "HOST or SH or !" on page 3-31 show the colum...
ISQL and Tools 3-6 FairCom Corporation 3.4.1 Formatting Column Display with the COLUMN Statement You can specify the width of the display for character columns with the COLUMN statement's "An" format string. Specify the format string in the FORMAT clause of the COLUMN state-ment. You need to...
ISQL Statements FairCom Corporation 3-7 Example 3-3: Customizing Format of Numeric Column Displays ISQL> column order_value format "$99,999,999.99" ISQL> column; -- Show all the COLUMN statements now in effect: column CUSTOMER_NAME format "A19" heading "CUSTOMER_NAME" c...
ISQL and Tools 3-8 FairCom Corporation whenever the value in the customer_name column changes. In other words, we need to specify a column break on the customer_name column. Approach this task in two steps. First, devise a DISPLAY statement to display the customer name and confirm that it is display...
ISQL Statements FairCom Corporation 3-9 The following example also issues two more DISPLAY statements to display the variable val-ues. As before, the DISPLAY statements must specify the customer_name break. They also indent their display farther to indicate the relationship with the previously issue...
ISQL and Tools 3-10 FairCom Corporation The TITLE statement lets you specify text that ISQL displays before (TITLE TOP) or after (TITLE BOTTOM) the query results. The title can also be horizontally positioned by specifying the keywords LEFT, CENTER, or RIGHT; or by specifying the actual column numbe...
ISQL Statements FairCom Corporation 3-11 End of Orders Summary Report 23 records selected ISQL> 3.5 THE 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 op...
ISQL and Tools 3-12 FairCom Corporation <SQL statement> ROLLBACK WORK ; An SQL statement starting immediately after a COMMIT WORK or ROLLBACK WORK statement starts a new transaction. 3.7 ISQL REFERENCE This section provides reference material for statements specific to ISQL. This section does ...
ISQL Statements FairCom Corporation 3-13 insert into stores values (1001,chassis); insert into stores values (1002,chips); select * from stores where item_no > 1001; set echo off ; To execute the above statements stored in a file named cmdfile , enter: ISQL> @cmdfile 3.7.2 BREAK Syntax BREAK [...
ISQL and Tools 3-14 FairCom Corporation SKIP n The optional SKIP clause can be used to skip the specified number of lines when the specified break occurs and before processing of any associated DISPLAY statements. Examples The following examples illustrate how various break settings and correspondin...
ISQL Statements FairCom Corporation 3-15 ISQL> select customer_name from customers; CUSTOMER_NAME ------------- Sports Cars Inc. Break on every row! Mighty Bulldozer Inc. Break on every row! Ship Shapers Inc. Break on every row! . . . ISQL> break on page ISQL> select customer_name from cust...
ISQL and Tools 3-16 FairCom Corporation | BREAK | COLUMN | COMPUTE | DISPLAY | TITLE Description The CLEAR statement removes settings made by the ISQL statement corresponding to option. Argument option Which ISQL statement's settings to clear: • CLEAR HISTORY - Clears the ISQL statement history buff...
ISQL Statements FairCom Corporation 3-17 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. Argume...
ISQL Statements FairCom Corporation 3-19 Examples The following examples are based on a table, orders , with columns defined as follows: ISQL> table orders COLNAME NULL ? TYPE LENGTH ------- ------ ---- ------ order_id NOT NULL INT 4 customer_id INT 4 steel_type CHAR 20 W The week of month as a 1...
ISQL and Tools 3-20 FairCom Corporation order_info CHAR 200 order_weight INT 4 order_value INT 4 order_state CHAR 20 ISQL displays the order_info column, at 200 characters, with lots of blank space preceding the values: ISQL> select order_info from orders where order_value < 1000000 ORDER_INFO...
ISQL Statements FairCom Corporation 3-21 Thursday 1 record selected ISQL> column sysdate format "Month" ISQL> select sysdate from syscalctable SYSDATE ------- May 1 record selected ISQL> column sysdate format "DDth" ISQL> select sysdate from syscalctable SYSDATE ------- 7...
ISQL and Tools 3-22 FairCom Corporation COMPUTE statements have no effect until you issue a BREAK statement with the same break_spec . Issuing the COMPUTE statement without any arguments displays the currently-set COM-PUTE specifications, if any. Arguments AVG | MAX | MIN | SUM | COUNT The function ...
ISQL Statements FairCom Corporation 3-23 3.7.6 DEFINE Syntax DEFINE [ variable_name = value ] ; Description The DEFINE statement defines a variable and assigns an ASCII string value to it. When you refer to the defined variable in DISPLAY statements, ISQL prints the value. The DEFINE statement is us...
ISQL and Tools 3-24 FairCom Corporation 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 ar...
ISQL Statements FairCom Corporation 3-25 ISQL> display col 5 "Number of orders placed by", customer_name, "=", n_ord on customer_name ISQL> compute count of order_id in n_ord on customer_name; ISQL> select c.customer_name, o.order_id from customers c, orders o where o.custom...
ISQL and Tools 3-26 FairCom Corporation edited. When you exit the editor, ISQL writes the buffer contents as the last statement in the history buffer. By default, ISQL invokes the vi editor on UNIX and the MS-DOS editor on NT. You can change the default by setting the EDITOR environment variable: • ...
ISQL Statements FairCom Corporation 3-27 3.7.10 GET Syntax G[ET] filename; Description The GET statement reads the first SQL statement stored in the specified script file. Arguments filename The name of the script file. ISQL reads the file until it encounters a semicolon ( ; ) statement terminator. ...
ISQL Statements FairCom Corporation 3-31 3.7.13 HOST or SH or ! Syntax { HOST | SH | ! } [host_command]; Description The HOST statement executes a host operating system command without terminating the cur-rent ISQL session. Arguments HOST | SH | ! Synonyms for directing ISQL to execute an operating ...
ISQL and Tools 3-32 FairCom Corporation 3.7.14 LIST Syntax L[IST] [ stmt_num ]; Description The LIST statement displays the statement with the specified statement number from the state-ment history buffer and makes it the current statement by adding it to the end of the history list. If LIST omits s...
ISQL Statements FairCom Corporation 3-33 3.7.15 QUIT or EXIT Syntax Q[UIT] Description The QUIT statement terminates the current ISQL session. Related Statements QUIT and EXIT are synonymous. There is no difference in their effect. 3.7.16 RUN Syntax R[UN] [stmt_num]; Description The RUN statement ex...
ISQL Statements FairCom Corporation 3-35 | COMMAND LINES number_lines | REPORT { ON | OFF } | ECHO { ON | OFF } | PAUSE { ON | OFF } | TIME { ON | OFF } | DISPLAY COST { ON | OFF } | AUTOCOMMIT { ON | OFF } | TRANSACTION ISOLATION LEVEL isolation_level | CONNECTION { database_name | DEFAULT } Descri...
ISQL and Tools 3-36 FairCom Corporation DISPLAY COST ON | OFF SET DISPLAY COST ON displays the values the c-treeSQL optimizer uses to calculate the least-costly query strategy for a particular SQL statement. The UPDATE STATISTICS statement updates the values displayed by SET DISPLAY COST ON. SET DIS...
ISQL Statements FairCom Corporation 3-37 sys_chkcol_usage sys_keycol_usage Here's a page break! . . . ISQL> SET DISPLAY COST ON ISQL> -- Select from the one-record SYSCALCTABLE table: ISQL> SELECT * FROM SYSCALCTABLE; Estimated Cost Values : ----------------------- COST : 8080 CARDINALITY :...
ISQL and Tools 3-38 FairCom Corporation ____________________ EDITOR ..................... : vi HISTORY buffer size ........ : 50 PAUSE ..................... : ON COMMAND LINES .............. : 10 TIMEing command execution.. : OFF SPOOLing ................... : ON LINESIZE .................. : 78 REP...
ISQL Statements FairCom Corporation 3-39 Example To record the displayed output into the file called STK, enter: ISQL> SPOOL STK ON ; ISQL> SELECT * FROM customer ; ISQL> SPOOL OFF ; 3.7.21 START Syntax ST[ART] filename [ argument ] [ ... ] ; Description The START statement executes the fir...
ISQL and Tools 3-40 FairCom Corporation ISQL> -- Display a script file with the ! shell statement. The script's SQL ISQL> -- statement uses the LIKE predicate to retrieve customer names ISQL> -- beginning with the string passed as an argument in a START statement: ISQL> ! more start_ex.s...
ISQL Statements FairCom Corporation 3-41 has_ccnstrs NOT NULL VARCHAR 1 has_ucnstrs NOT NULL VARCHAR 1 tbl_status NOT NULL VARCHAR 1 rssid NOT NULL INT 4 The following example uses the table command to detail the structure of the tables used in examples throughout this chapter. ISQL> table - List...
ISQL and Tools 3-42 FairCom Corporation lot_id NOT NULL INT 4 purity DOUBLE 8 p_deviation DOUBLE 8 strength DOUBLE 8 s_deviation DOUBLE 8 comments CHAR 200 ISQL> table samples COLNAME NULL ? TYPE LENGTH ------- ------ ---- ------ lot_id INT 4 samples INT 4 comments CHAR 200 ISQL> 3.7.23 TITLE ...
FairCom Corporation 4-1 Chapter 4 Data Load Utility: dbload 4.1 INTRODUCTION This chapter describes the c-treeSQL database load utility, dbload . This utility loads records from an input data file into tables of a database. The format of the data file is specified by a record description given in an...
ISQL and Tools 4-2 FairCom Corporation Figure 4-1: dbload Execution Process 4.2 PREREQUISITES FOR DBLOAD Before running dbload , you need: • A valid, readable commands file • INSERT privileges on the tables named in the commands file 4.3 DBLOAD COMMAND LINE SYNTAX The dbload command does not directl...
Data Load Utility: dbload FairCom Corporation 4-3 -l logfile Specifies the file into which the error logging is done. stderr is the default. dbload also writes statistics to the file: • Number of records read • Number of records skipped • Number of records loaded • Number of records rejected -b badf...
ISQL and Tools 4-4 FairCom Corporation 4.4.1 Variable Length Records For variable length records, the fields in the data file can be of varying length. Unless the key-word FIXED is used in the commands file, it is assumed that the dbload record processing will be for variable length records. 4.4.2 F...
Data Load Utility: dbload FairCom Corporation 4-5 4.5.1 The DEFINE RECORD Statement The DEFINE RECORD statement is used to define the record that is to be loaded into the data-base. It describes the data found in the data file. The following are the definitions that are made known by the DEFINE RECO...
ISQL and Tools 4-6 FairCom Corporation • start_position is the position where the field starts. It must be an unsigned integer. • end_position is the position where the field ends. It must be an unsigned integer. The first position of each record is 1 and not 0. If date and time types are to be inse...
Data Load Utility: dbload FairCom Corporation 4-7 statement. The following example shows the list interchanged with respect to the list in the DEFINE RECORD statement. DEFINE RECORD dept_rec AS ( dept_no, dept_name, location ) FIELD DELIMITER ' ' ; FOR EACH RECORD dept_rec FROM dept_in INSERT INTO A...
ISQL and Tools 4-8 FairCom Corporation The following is the commands file to load records into the orders table. The input data file is orders_in which is a binary file in the fixed length record format. DEFINE RECORD orders_rec OF FIXED LENGTH 30 AS ( order_no POSITION (1:4) LONG, order_date POSITI...
Data Load Utility: dbload FairCom Corporation 4-9 Position for SHORT not specified correctly. The size of the field (start position to end position) must be equal to the size of SHORT. Position for LONG not specified correctly. The size of the field (start position to end position) must be equal to ...
FairCom Corporation 5-1 Chapter 5 Data Unload Utility: dbdump 5.1 INTRODUCTION This chapter describes the c-treeSQL database dump utility, dbdump . dbdump writes the data in a database to a file. The format of the exported data is specified by the record description given in an input command file to...
ISQL and Tools 5-2 FairCom Corporation • SELECT privileges on the tables named in the commands file 5.3 DBDUMP COMMAND LINE SYNTAX The dbdump command accepts the commands file name, the database name and a command option. Syntax dbdump -f commands_file [-n] database_name Options -f commands_file Spe...
Data Unload Utility: dbdump FairCom Corporation 5-3 The syntax definition for the commands file is as shown: dbdump_commands: define_record_statement for_record_statement The following is sample commands file showing dump instructions. DEFINE RECORD ord_rec AS ( ord_no, item_name, date, item_qty ) F...
ISQL and Tools 5-4 FairCom Corporation • record_length is the length of the fixed length record. This length should include the length of field or record delimiters, if any. • field_name is the name used to refer to a field in the data file. • delimiter_char is the field delimiter and is a single ch...
FairCom Corporation 6-1 Chapter 6 Schema Export Utility: dbschema 6.1 INTRODUCTION This chapter describes the c-treeSQL utility, dbschema . This utility recreates specified data- base elements and data. Syntax dbschema [ -h ] [ -d ] [-u user_name ] [-a password ] [ -o outfile ] [ -p [ user_name.]pro...
Schema Export Utility: dbschema FairCom Corporation 6-3 ADMIN@isis% dbschema -t dbp1,test_view rdsdb DBSCHEMA create table ADMIN.dbp1 ( c1 integer ) pctfree 20; create view ADMIN.test_view ( fld ) as select * from test_revoke1 ; The following example uses the -p option with the % wildcard character ...
FairCom Corporation A-1 Appendix A Tutorial Source Code A.1 INTRODUCTORY TUTORIAL CREATE TABLE CUSTMAST ( cm_custnum VARCHAR(5), cm_zip VARCHAR(10), cm_state VARCHAR(3), cm_rating VARCHAR(2), cm_name VARCHAR(48), cm_address VARCHAR(48), cm_city VARCHAR(48) ); COMMIT WORK; INSERT INTO CUSTMAST VALUES...
FairCom Corporation Index-i Index Symbols @Execute syntax . . . . . . . . . . . . . . . . . . . . . 3-12 A Adding titles . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 B Beginning titles . . . . . . . . . . . . . . . . . . . . . . . 3-9 BREAK statement . . . . . . . . . . . . . . . . . . . ...
HP Manuals
-
HP CM1312 MFP
Manual
-
HP DV2700
Manual
-
HP 203A
Manual
-
HP 13-2000
Manual
-
HP 1320NW
Manual
-
HP D4360
Manual
-
HP W19Q
Manual
-
HP FC2143
Manual
- HP ZV6000 Manual
-
HP 7500
Manual
-
HP C4591A
Manual
-
HP E4411B
Manual
-
HP N6310
Manual
- HP nx7000 Manual
-
HP DL120
Manual
- HP w1707 Manual
-
HP CV136A#B1H
Manual
-
HP X585z
Manual
-
HP 686714-S01
Manual
- HP 1200 series Manual