Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

copydb(1sql)

intro(1sql)

isql(1sql)

accessdb(8sql)

intro(8sql)

sql(1sql)

Name

sql − invoke the ULTRIX/SQL terminal monitor

Syntax

sql [options] [<altin] [>altout] dbname

Description

The sql command invokes the ULTRIX/SQL terminal monitor, which allows you to enter ULTRIX/SQL commands interactively. The parameter dbname is the name of an existing database that you will open for the terminal monitor session.  The optional parameter altin, preceded by the < redirection character, is a file that contains all the terminal monitor commands needed to run an ULTRIX/SQL session.  For example, you can specify the redirection character < and the name of an SQL interactive procedure that processes the output of the copydb command. The optional parameter altout, which is preceded by the > redirection character, is the name of a file to capture all output from the terminal monitor session.  You can save this file for future reference.  Note that the terminal monitor does not display any output on the terminal screen if you direct output to a file. 
 

Options

+U|-U
Enable/disable user ability to update the system catalog tables and secondary indexes. You must have the update system tables privilege obtained through the accessdb utility to enter the sql command with the +U option.  The +U option is provided for system debugging and is strongly discouraged for normal use.  Note that using the +U option causes an exclusive lock to be placed on the database during the session for which it is specified.  The default is −U. 

−uusername
Specify database access under the login name username (found in the ULTRIX/SQL users file).  This option may be used only by the DBA for the database or by the ULTRIX/SQL system administrator.

−cNSet the minimum field width for printing character columns to N characters.  The default minimum field width is 6 characters. 

−tNSet the minimum field width for printing text columns to N characters.  The default minimum field width is 6 characters. 

−ikNSet integer output column width to N characters.  The integer type k may be 1, 2 or 4 for 1-, 2-, and 4-byte integer data types, respectively. The default for output column width (N) is 6 for 1- and 2-byte integer data types, and 13 for the 4-byte integer data type. 

−fkxM.N
Set floating-point output field width to M characters (total), including: N decimal places, e+-xx (if warranted), and the decimal point character itself. The floating-point type k can be 4 or 8, to apply to 4- and 8-byte floating-point values, respectively. The output format x can be E, F, G or N (upper- or lowercase).  For a value to be displayed in E (exponential) output format, either E must be explicitly specified as the output format type or the value must be too large to display using any output format other than E.  F specifies floating-point output format.  G and N output formats are identical to those for F, unless a floating-point value is so large that it must be displayed using E format. Note that G format guarantees decimal point alignment; N does not. The default output format for both 4- and 8-byte floating-point values on VAX systems is n10.3.  On RISC systems, which support the IEEE standard for floating-point values, the default output format for 4- and 8-byte floating-point values is n11.3. 

−vXSet the character that separates columns in output displays to be the character you specify for X. The default column separator is a vertical bar (|). 

−nMSet modify mode for the commands that affect an index to M.  For M, you can specify heap, cheap, heapsort, cheapsort, isam, cisam, btree, cbtree, hash and chash. The default modify mode is isam. 

+a|−a
Set/clear the autoclear option for the terminal monitor session. The default is +a (set autoclear). 

−lLock the database for your exclusive use. When you specify this option, no one else can open the database while you have it open. If you attempt to use this option and the database whose name you specify is already opened, ULTRIX/SQL returns the error that the database is temporarily unavailable. 

+d|−d
Print/do not print the dayfile. The default is +d. 

+s|−s
Print/do not print any of the monitor messages, including prompts. If −s is specified, −d is also implied; in other words, the messages that you disable with the −s include the dayfile display.  The default is +s. 

+w|−w
Wait/do not wait for the specified database to be available.  The default is −w.  If you specify the +w option, ULTRIX/SQL waits, provided that certain processes
( sql −l, sql −U, verifydb, rollforward, and sysmod ) are running on the given database. Upon completion of those processes, ULTRIX/SQL opens the database on your behalf. When the −w option is specified and the database is not available, an error message is returned.  You can apply the +w option only if standard input is from a terminal; in other words, sql does not wait for database availability when input to the terminal monitor is from a file rather than from the terminal.

−xkSet severity level for arithmetic exceptions. For k, you can specify f or w. An f indicates that all arithmetic exceptions (floating-point overflow and underflow, integer overflow, and divide-by-zero) should be treated as fatal errors.  When severity level is f, the detection of an arithmetic exception terminates processing of the command that is being executed.  Specify w to indicate that warnings rather than fatal errors should be generated for arithmetic exceptions.  When severity level is w, a command continues to execute on detection of an arithmetic exception, and a summary of detected exceptions is generated. The default is to ignore exceptions. 

Examples

Open the empdata database:

sql empdata

Open empdata, suppressing the dayfile message:

sql -d empdata

Open empdata, suppressing both the dayfile message and the terminal monitor prompts and messages; reading into the terminal monitor session the contents of my-queries:

sql -s < my-queries empdata

Open empdata, display 4-byte floating-point column values in G output format with two decimal places, and display 1-byte integer column values with three characters.

sql -f4g12.2 -i13 empdata

Files

$II_DATABASE/ingres/data/default/dbname
Default directory for database files associated with dbname.  The default location ii_database is mapped to this directory. 

See Also

copydb(1sql), intro(1sql), isql(1sql), accessdb(8sql), intro(8sql)

ULTRIX/SQL Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026