isql

Description

Interactive SQL parser to Adaptive Server. Located in $SYBASE/$SYBASE_OCS/bin.

Windows The utility is isql.exe, located in %SYBASE%\%SYBASE_OCS%\bin.

Syntax

isql [-b] [-e] [-F] [-p] [-n] [-v] [-W] [-X] [-Y] [-Q]
	[-a display_charset]
	[-A packet_size]
	[-c cmdend]
	[-D database]
	[-E editor]
	[-h header]
	[-H hostname]
	[-i inputfile]
	[-I interfaces_file]
	[-J client_charset]
	[-K keytab_file]
	[-l login_timeout]
	[-m errorlevel]
	[-o outputfile]
	[-P password]
	[-R remote_server_principal]
	[-s colseparator]
	[-S server_name]
	[-t timeout]
	-U username
	[-V [security_options]]
	[-w columnwidth]
	[-z locale_name]
	[-Z security_mechanism]
	[--conceal]

NoteSee Table 7-2 for a list and description of commands that can be executed from within isql.

Parameters

-b

disables the display of the table headers output.

-e

echoes input.

-F

enables the FIPS flagger. When you specify the -F parameter, the server returns a message when it encounters a non-standard SQL command. This option does not disable SQL extensions. Processing completes when you issue the non-ANSI SQL command.

-p

prints performance statistics.

-n

removes numbering and the prompt symbol (>) from the echoed input lines in the output file when used in conjunction with -e.

-v

prints the version number and copyright message for isql and then exits.

-X

initiates the login connection to the server with client-side password encryption. -X enables both extended password encrypted connections and password encrypted connections without plain text password reconnection. isql (the client) specifies to the server that password encryption is desired. The server sends back an encryption key, which isql uses to encrypt your password, and the server uses the key to authenticate your password when it arrives.

If isql crashes, the system creates a core file that contains your password. If you did not use the encryption option, the password appears in plain text in the file. If you used the encryption option, your password is not readable.

-W

disables both extended password and password encrypted negotiations

-Y

tells the Adaptive Server to use chained transactions.

-Q

provides clients with failover property. See Using Sybase Failover in a High Availability System for more information.

-a display_charset

runs isql from a terminal whose character set differs from that of the machine on which isql is running. Use -a in conjunction with -J to specify the character set translation file (.xlt file) required for the conversion. Use -a without -J only if the client character set is the same as the default character set.

NoteThe ascii_7 character set is compatible with all character sets. If either the Adaptive Server character set or the client character set is set to ascii_7, any 7-bit ASCII character can pass unaltered between client and server. Other characters produce conversion errors. For more information on character set conversion, see the System Administration Guide.

-A packet_size

specifies the network packet size to use for this isql session. For example, the following sets the packet size to 4096 bytes for this isql session:

isql -A 4096
  • To check your network packet size, enter:

    select * from sysprocesses
    
  • The value is displayed under the network_pktsz heading.

  • size must be between the values of the default network packet size and maximum network packet size configuration parameters, and must be a multiple of 512.

  • Use larger-than-default packet sizes to perform I/O-intensive operations, such as readtext or writetext operations.

  • Setting or changing Adaptive Server’s packet size does not affect the packet size of remote procedure calls.

-c cmdend

changes the command terminator. By default, you terminate commands and send them to by typing “go” on a line by itself. When you change the command terminator, do not use SQL reserved words or control characters.

-D database

selects the database in which the isql session begins.

-E editor

specifies an editor other than the default editor vi. To invoke the editor, enter its name as the first word of a line in isql.

-h headers

specifies the number of rows to print between column headings. The default prints headings only once for each set of query results.

-H hostname

sets the client host name.

-i inputfile

specifies the name of the operating system file to use for input to isql. The file must contain command terminators (“go” is the default).

  • Specifying the parameter as follows is equivalent to < inputfile:

    -i inputfile
    
  • If you use -i and do not specify your password on the command line, isql prompts you for it.

  • If you use inputfile and do not specify your password on the command line, you must specify your password as the first line of the input file.

-I interfaces_file

specifies the name and location of the interfaces file to search when connecting to Adaptive Server. If you do not specify -I, isql looks for a file named interfaces in the directory specified by your SYBASE environment variable.

-J client_charset

specifies the character set to use on the client. -J client_charset requests that Adaptive Server convert to and from client_charset, the character set used on the client. A filter converts input between client_charset and the Adaptive Server character set.

-J with no argument sets character set conversion to NULL. No conversion takes place. Use this if the client and server use the same character set.

Omitting -J sets the character set to a default for the platform. The default may not necessarily be the character set that the client is using. For more information about character sets and the associated flags, see “Configuring Client/Server Character Set Conversions,” in the System Administration Guide, Volume One.

-K keytab_file

specifies the path to the keytab file used for authentication in DCE.

-l login_timeout

specifies the maximum timeout value allowed when connecting to Adaptive Server. The default is 60 seconds. This value affects only the time that isql waits for the server to respond to a login attempt. To specify a timeout period for command processing, use the -t timeout parameter.

-m errorlevel

customizes the error message display. For errors of the severity level specified or higher, only the message number, state, and error level are displayed; no error text appears. For error levels lower than the specified level, nothing appears.

-o outputfile

specifies the name of an operating system file to store the output from isql. Specifying the parameter as -o outputfile is similar to outputfile

-P password

specifies your Adaptive Server password. If you do not specify the -P flag, isql prompts for a password. If your password is NULL, use the -P flag without any password.

-R remote_server_principal

specifies the principal name for the server as defined to the security mechanism. By default, a server’s principal name matches the server’s network name (which is specified with the -S parameter or the DSQUERY environment variable). Use the -R parameter when the server’s principal name and network name are not the same.

-s colseparator

resets the column separator character, which is blank by default. To use characters that have special meaning to the operating system (for example, “|”, “;”, “&”, “<”, “>”), enclose them in quotes or precede them with a backslash.

The column separator appears at the beginning and the end of each column of each row.

-S server_name

specifies the name of the Adaptive Server to which to connect. isql looks this name up in the interfaces file. If you specify -S with no argument, isql looks for a server named SYBASE. If you do not specify -S, isql looks for the server specified by your DSQUERY environment variable.

-t timeout

specifies the number of seconds before a SQL command times out. If you do not specify a timeout, the command runs indefinitely. This affects commands issued from within isql, not the connection time. The default timeout for logging into isql is 60 seconds.

-U username

specifies a login name. Login names are case sensitive.

-V security_options

specifies network-based user authentication. With this option, the user must log in to the network’s security system before running the utility. In this case, users must supply their network user name with the -U option; any password supplied with the -P option is ignored.

You can follow -V with a security_options string of key-letter options to enable additional security services. These key letters are:

  • c – Enable data confidentiality service

  • i – Enable data integrity service

  • m – Enable mutual authentication for connection establishment

  • o – Enable data origin stamping service

  • q – Enable out-of-sequence detection

  • r – Enable data replay detection

-w columnwidth

sets the screen width for output. The default is 80 characters. When an output line reaches its maximum screen width, it breaks into multiple lines.

-z locale_name

specifies the official name of an alternate language to display isql prompts and messages. Without -z, isql uses the server’s default language. You can add languages to an Adaptive Server during installation or afterward, using the langinstall utility (langinst in Windows) or the sp_addlanguage stored procedure.

-Z security_mechanism

specifies the name of a security mechanism to use on the connection.

Security mechanism names are defined in the libtcl.cfg configuration file located in the ini subdirectory below the Sybase installation directory. If no security_mechanism name is supplied, the default mechanism is used. For more information on security mechanism names, see the description of the libtcl.cfg file in the Open Client and Open Server Configuration Guide.

--conceal

Hides your input during an isql session. The --conceal option is useful when entering sensitive information, such as passwords. The syntax for the --conceal option is:

isql --conceal [':?' | 'wildcard']

The maximum length of wildcard, a 32-byte variable, is 80 characters.

Note--conceal is silently ignored in batch mode.

Examples

Example 1

Puts you in a text file where you can edit the query. When you write and save the file, you are returned to isql. The query appears; type “go” on a line by itself to execute it:

isql -Ujoe -Pabracadabra
1> select *
2> from authors
3> where city = "Oakland"
4> vi

Example 2

reset clears the query buffer. quit returns you to the operating system:

isql -Ualma
Password:
1> select *
2> from authors
3> where city = "Oakland"
4> reset
1> quit

Example 3

Specifies that you are running isql from a Macintosh against a server that is using the roman8 character set:

isql -a mac -J roman8

Example 4

Creates column separators using the “#” character in the output in the pubs2 database for store ID 7896:

isql -Usa -P -s#
1> use pubs2
2> go
1> select * from sales where stor_id = "7896"
#stor_id#ord_num             #date                      #
#-------#--------------------#--------------------------#
#7896   #124152              #       Aug 14 1986 12:00AM#
#7896   #234518              #       Feb 14 1991 12:00AM#

(2 rows affected)

Example 5

Changes password without displaying the password entered. This example uses “old” and “new” as prompt labels:

$ isql -Uguest -Pguest -Smyase --conceal
sp_password
:? old
,
:?:? new
----------------
old
new
Confirm new
Password correctly set.

(Return status 0)

Example 6

Activates a role for the current user. This example uses a custom wildcard and the prompt labels “role” and “password:”

$ isql -UmyAccount --conceal '*'Password:
set role
* role
with passwd
** password
on
go

role
password
Confirm password

Example 7

Changes password without displaying the password entered. This example uses the default wildcard as the prompt label:

Usage

See also

Commands create schema, set

Datatype exact numeric datatypes

Documentation Chapter 2, “Using Interactive isql from the Command Line” for details on isql, and the Reference Manual for more information regarding default network packet size and maximum network packet size configuration parameters.

Functions convert

System ESP xp_sendmail

System procedures sp_addlanguage, sp_addlogin, sp_addremotelogin, sp_add_resource_limit, sp_bindexeclass, sp_configure, sp_defaultlanguage, sp_droplanguage, sp_helplanguage, sp_processmail, sp_remoteoption, sp_serveroption, sp_showcontrolinfo, sp_unbindexeclass, sp_volchanged