Contents Index Starting Interactive SQL from Sybase Central Interactive SQL utility options

ASA Database Administration Guide
  Database Administration Utilities
    The Interactive SQL utility

Opening Interactive SQL using the dbisql command-line utility


Syntax 

dbisql [ options ] [ dbisql-command | command-file ]

Option Description
-c "keyword=value; ..." Supply database connection parameters
-codepage codepage Specify a codepage to use when reading or writing files
-d delimiter Use the given string as the command delimiter
-d1 Print statements as they are executed [command-prompt mode only]
-f fileName Open (without running) the file called 'fileName'.
-datasource dsn-name Specify an ODBC data source to connect to
-host hostname Specify the hostname or IP address of the machine running a database server
-jConnect Use jConnect to connect to the database
-nogui Run in command-prompt mode
-ODBC Use the iAnywhere JDBC Driver to connect to the database
-onerror { continue | exit } Override the ON_ERROR option for all users
-port portnumber Look on the specified port number for the database server
-q Quiet mode—no windows or messages
-x Syntax check only—no commands executed
Description 

Interactive SQL 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.

If dbisql-command is specified, Interactive SQL executes the command. You can also specify a command file name. If no dbisql-command is specified, Interactive SQL enters interactive mode, where you can type a command into a command window.

Exit codes are 0 (success) or non-zero (failure).

Interactive SQL requires that the QUOTED_IDENTIFIER database option be set to ON since a number of database functions, including some statements, rely on this setting to function properly. Interactive SQL automatically sets it ON when connecting to a database.

This utility does not accept @filename parameters. For more information, see @filename server option.

Examples 

The following command, entered at a command prompt, runs the command file mycom.sql against the current default server, using the user ID DBA and the password SQL. If there is an error in the command file, the process terminates.

dbisql -c "uid=DBA;pwd=SQL" -onerror exit mycom.sql

The following command, when entered on a single line at a system prompt, adds a user to the current default database:

dbisql -c "uid=DBA;pwd=SQL" grant connect to joe identified by passwd

Interactive SQL utility options

Contents Index Starting Interactive SQL from Sybase Central Interactive SQL utility options