Sybase recommends that you use the dbisql utility instead of dbisqlc. The dbisqlc utility may not be supported in future releases.
The dbisql command runs Interactive SQL Java. The Java version has many advantages and more features, including multiple windows, each opening a separate database connection. The Interactive SQL Classic utility described in this section is 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. You can either type SQL commands, or run command files. dbisqlc also provides feedback about the number of rows affected, the time required for each command, the execution plan of queries, and any error messages.
For dbisql to function correctly, $HOME must exist and must be writable by the user.
dbisqlc [ options ] [ dbisqlc-command | command-file ]
Table 2-5 lists the available options for dbisqlc.
Option |
Description |
---|---|
-c "keyword=value; ..." |
Supply database connection parameters. |
-d delimiter |
Specify command delimiter. |
-q |
Quiet mode—no windows or messages. |
-r |
Return 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 |
Check syntax only—no commands executed. |
To customize dbisqlc, change to your home directory ($HOME) and issue the following command to copy the default.tix file into it:
% cp $IQDIR15/tix/default.tix .
This file controls key sequences for dbisqlc and improves the appearance of the command window. See “Shift and Ctrl Keys”.
dbisqlc-command | command-file If dbisqlc-command is specified, then dbisqlc executes the command. You can also specify a command file name. If you do not specify a dbisql-command, dbisqlc enters the interactive mode, where you can type a command into a command window. In Windows, you can enter interactive mode by selecting Start > Programs > Sybase > Sybase IQ 15.1 > Interactive SQL Classic.
-c "keyword=value; ..." Specify connection parameters. See Chapter 4, “Connection and Communication Parameters” in the System Administration Guide: Volume 1. If you do not specify any connection parameters, the environment variable SQLCONNECT is used. If Interactive SQL cannot connect, enter the appropriate parameters in the dialog box that appears.
Sybase 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 you start more than one database on a server, for example, specify the database name, and in a network with subnets, specify the communications protocol parameter with host number. See Chapter 3, “Sybase IQ Connections” in the System Administration Guide: Volume 1.
-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 may be useful when you are querying stored procedures.
-x Scan commands but do not execute them. You may find this option useful for checking long command files for syntax errors.
The examples in this section illustrate how to use dbisqlc from the system command prompt. The rest of the dbisqlc sections in this chapter discuss how to use dbisqlc interactively.
The following command, entered at a system prompt, runs the command file mycom.sql against the current default server, using the user ID dba and the password sql. Note that the default password is case-sensitive but the user ID is not.
dbisqlc -c "uid=DBA;pwd=sql" mycom.sql
The following command, entered at a system prompt, adds a user to the current default database:
dbisqlc -c "uid=DBA;pwd=sql" grant connect to joe identified by passwd
For detailed descriptions of SQL statements and dbisql commands, see Chapter 1, “SQL Statements” inReference: Statements and Options.