The Interactive SQL Classic (dbisqlc) utility

NoteThe dbisql command now runs an enhanced version of Interactive SQL that is a Java application. The Java version has many advantages, including multiple windows, each opening a separate database connection. The version of the Interactive SQL utility described in this section is now called dbisqlc to distinguish it from the Java version. For information about the Java version, see “The Interactive SQL (dbisql) utility”.

dbisqlc provides the user with an interactive environment for database browsing and for sending SQL statements to the database server.

dbisqlc allows you to type SQL commands, or run command files. It also provides feedback about the number of rows affected, the time required for each command, the execution plan of queries, and any error messages.

Syntax

dbisqlc [ options ] [ dbisqlc-command | command-file ]

Parameters

Table 2-5: “dbisqlc options” lists the available options for dbisqlc.

Table 2-5: dbisqlc options

Option

Description

-c "keyword=value; ..."

Supply database connection parameters

-d delimiter

Specify command delimiter

-q

Quiet mode—no windows or messages

-r

Returns the error “Not enough fields allocated in sqlda,” if the defined result set of the stored procedure does not match the actual result set.

-x

Syntax check only—no commands executed

Usage

Note that for Sybase IQ 12, the Help menu item does not open online help for dbisqlc, but help is available in Sybase Central. In Sybase Central, choose Help Æ Sybase IQ Help, then click the Index tab. Type dbisqlc in the Topic or Keyword box and click the Go To button.

If you would like to customize dbisqlc, change to your home directory ($HOME) and issue the following command to copy the terminfo extension file default.tix into it:

% cp $ASDIR/tix/default.tix .

This file controls key sequences for dbisqlc and improves the command window display. For more information, see “Shift and Control Keys”.

dbisqlc-command | command-file If dbisqlc-command is specified, then dbisqlc executes the command. You can also specify a command file name. If no dbisql-command is specified, dbisqlc enters the interactive mode where you can type a command into a command window. From the Windows Start menu, you can enter interactive mode by selecting Programs → Sybase → Adaptive Server IQ 12.6 → Interactive SQL Classic.

-c "keyword=value; ..." Specify connection parameters. See Chapter 4, “Connection and Communication Parameters” in the Sybase IQ System Administration Guide for a description of the connection parameters. If this option is not specified, the environment variable SQLCONNECT is used. If Interactive SQL cannot connect, you are presented with a dialog box where you can enter the connection parameters.

NoteSybase recommends that, to avoid ambiguity, you always specify connection parameters for dbisqlc instead of relying on defaults, whether you specify them in a command line or an initialization file such as .odbc.ini on UNIX, or odbc.ini on Windows. If more than one database is started on a server, for example, you should specify the database name, and in a network with subnets, specify the communications protocol parameter with host number. For details, see Chapter 3, “Sybase IQ Connections” in the Sybase IQ System Administration Guide.

-d Specify a command delimiter. By default, the delimiter is the semi-colon.

-q Do not display output messages. This option is useful only if you start Interactive SQL with a command or command file.

-r Returns the error “Not enough fields allocated in sqlda” if the defined result set of the stored procedure does not match the actual result set. This option is useful when querying stored procedures.

-x Scan commands but do not execute them. This option is useful for checking long command files for syntax errors.

Examples

The examples in this section illustrate using dbisqlc at the system command prompt level. The rest of the dbisqlc sections in this chapter discuss how to use dbisqlc interactively.

dbisqlc -c "uid=DBA;pwd=SQL" mycom.sql
dbisqlc -c "uid=dba;pwd=SQL" grant connect to joe identified by passwd

See also

For detailed descriptions of SQL statements and dbisql commands, see Chapter 6, “SQL Statements” in the Sybase IQ Reference Manual.