Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - Database Administration » Administering Your Database » Database administration utilities

 

Interactive SQL utility (dbisqlc)

Executes SQL commands against a database.

For detailed descriptions of SQL statements and Interactive SQL commands, see SQL language elements.

Syntax
dbisqlc [ options ] [ dbisqlc-command | command-file ]
Option Description
-c "keyword=value; ..."

Specifies connection parameters. If Interactive SQL cannot connect, you are presented with a window where you can enter the connection parameters. See Connection parameters.

-d delimiter

Specifies a command delimiter. Quotation marks around the delimiter are optional, but are required when the command shell itself interprets the delimiter in some special way.

The specified command delimiter is used for all connections in the current dbisqlc session.

-q

Suppresses output messages. This is useful only if you start Interactive SQL with a command or command file. Specifying this option does not suppress error messages, but it does suppress the following:

  • warnings and other non-fatal messages
  • the printing of result sets
-x

Scans commands but does 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.

Remarks
Note

It is recommended that you use the Interactive SQL utility (accessed by using the dbisql command or by choosing Start » Programs » SQL Anywhere 11 » Interactive SQL) where possible because the dbisqlc utility does not support all the features that Interactive SQL does, and it does not support all of the features available in previous versions of the database server.

The dbisqlc utility allows you to type SQL commands or run command files.

The dbisqlc utility is supported on Windows, Mac OS X, and Unix.

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

Exit codes are 0 (success) or non-zero (failure). Only the dbisql utility has the ability to provide exit codes from a SQL script. See Interactive SQL utility (dbisql) and EXIT statement [Interactive SQL].

See also
Example

The following command 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 shuts down.

dbisqlc -c "UID=DBA;PWD=sql" mycom.sql

The following command adds a user to the current default database:

dbisqlc -c "UID=DBA;PWD=sql" CREATE USER joe IDENTIFIED BY passwd