ISQL and Tools

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.sql

SELECT customer_name FROM customers WHERE customer_name LIKE '&1%';

ISQL> -- Use the START statement to execute the SQL statement in the script ISQL> -- start_ex.sql. Supply the value 'Ship' as a substitution argument: ISQL> START start_ex.sql Ship

CUSTOMER_NAME

-------------

Ship Shapers Inc.

1 record selected

ISQL> -- ISQL puts the script statement, after argument substitution, ISQL> -- in the history buffer:

ISQL> history

1 ! more start_ex.sql

3START start_ex.sql Ship

4SELECT customer_name FROM customers WHERE customer_name LIKE 'Ship%'

3.7.22TABLE

Syntax

T[ABLE] [ tablename ] ;

Description

The TABLE statement with no argument displays a list of all the user tables in the database that are owned by the current user.

With the tablename argument, the TABLE statement displays a brief description of the col- umns in the specified table.

Examples

You can use the TABLE statement to see the structure of system tables. Unless you are logged in as the c-treeSQL database administrator (the user ADMIN, by default), you need to qualify the system table name with the administrator user name, as in the following example:

ISQL> table ADMIN.systables

NULL ?

TYPE

LENGTH

COLNAME

-------

------

----

------

id

NOT NULL

INT

4

tbl

NOT NULL

VARCHAR

32

creator

NOT NULL

VARCHAR

32

owner

NOT NULL

VARCHAR

32

tbltype

NOT NULL

VARCHAR

1

tblpctfree

NOT NULL

INT

4

segid

NOT NULL

INT

4

has_pcnstrs

NOT NULL

VARCHAR

1

has_fcnstrs

NOT NULL

VARCHAR

1

3-40

FairCom Corporation

Page 66
Image 66
HP c-tree-SQL ISQL and Tools manual Null ? Type Length Colname Not Null INT, Not Null Varchar