ASA Database Administration Guide
Database Administration Utilities
The Interactive SQL utility
Opening Interactive SQL using the dbisql command-line utility
-c Specify connection parameters. See Connection parameters for a description of the connection parameters. If Interactive SQL cannot connect, you are presented with a dialog where you can enter the connection parameters.
-codepage Specify the codepage to use when reading or writing files. The default code page is the default code page for the platform you are running on.
For example, on an English Windows NT machine, Interactive SQL uses the 1252 (ANSI) code page. If you want Interactive SQL to read files created using the 297 (IBM France) code page, specify the following option.
-codepage 297
For a list of supported code pages, see Supported code pages.
-d Specify a command delimiter. Quotation marks around the delimiter are optional, but required when the command shell itself interprets the delimiter in some special way.
Command delimiters are used for all connections in that Interactive SQL session, regardless of the setting stored in the database (for the user, or the PUBLIC setting).
-d1 (The final character is a number 1, not a lower-case L). Interactive SQL echoes all statements it executes to the Command window (STDOUT). This can provide useful feedback for debugging SQL scripts, or when Interactive SQL is processing a long SQL script.
-datasource Specify an ODBC data source to connect to. You do not need to be using the iAnywhere JDBC driver to use this option. However, if the data source to which you are connecting is not configured to use TCP/IP, you must use the iAnywhere JDBC driver to connect. Adaptive Server Anywhere data sources are configured to use TCP/IP by default.
-f filename Open (but do not run) the file called filename. The file name can be enclosed in quotation marks, and MUST be enclosed in quotation marks if the file name contains a blank. If the file does not exist, or if it's really a directory instead of a file, DBISQL prints an error message to the console and then quits. If the file name does not include a full drive and path specification, it is assumed to be relative to the current directory.
-host Specify the hostname or IP address of the computer on which the database server is running. You can use the name localhost to represent the current machine.
-jConnect Use the Sybase jConnect JDBC driver to connect to the database. This is the default method, and is recommended in most circumstances.
-nogui Run Interactive SQL in a command-prompt mode, with no windowed user interface. This is useful for batch operations.
In this mode, Interactive SQL sets the program exit code to indicate success or failure. On Windows operating systems, the environment variable ERRORLEVEL is set to the program exit code. The exit codes are as follows:
Program exit code | Description |
---|---|
0 | Success. |
1 | General failure. At some point, a SQL or Interactive SQL statement did not execute successfully and the user chose to stop executing SQL statements. Alternatively, Interactive SQL noted an internal error. |
5 | The user terminated interactive SQL. When an error occurs during execution, the user is prompted to ignore it, stop, or exit Interactive SQL. If the user opts to exit, the program returns code 5. Code 5 is also returned if an error occurs and the Interactive SQL option ON_ERROR is set to EXIT. |
9 | Unable to connect. |
255 | Bad command. The command contained incomplete or invalid options. |
-ODBC Connect using the iAnywhere JDBC driver. If you do not specify this option, Interactive SQL connects using jConnect.
-onerror Controls what happens if an error is encountered while reading statements from a command file. This option overrides the ON_ERROR setting. It is useful when using Interactive SQL in batch operations.
For more information, see ON_ERROR option [ISQL].
-port Specify the port number on which the database server is running. The default port number for Adaptive Server Anywhere is 2638.
-q Do not display output messages. This is useful only if you start Interactive SQL with a command or command file.
-x Scan commands but do not execute them. This is useful for checking long command files for syntax errors.
For detailed descriptions of SQL statements and Interactive SQL commands, see SQL Language Elements.