Interactive SQL parser to Adaptive Server. Located in $SYBASE/ASE-12_5/bin.
In Windows NT, the utility is isql.exe, located in %SYBASE%\ASE-12_5\bin.
isql [-b] [-e] [-F] [-p] [-n] [-v] [-X] [-Y] [-Q] [-a display_charset] [-A packet_size] [-c cmdend] [-D database] [-E editor] [-h headers] [-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]
To terminate a command:
go
To clear the query buffer:
reset
To call the default editor:
vi
To execute an operating system command:
!! command
To exit from isql:
quit
or
exit
disables the display of the table headers output.
echoes input.
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.
prints performance statistics.
removes numbering and the prompt symbol (>) from the echoed input lines in the output file when used in conjunction with -e.
prints the version number and copyright message for isql and then exits.
initiates the login connection to the server with client-side password encryption. 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.
tells the Adaptive Server to use chained transactions.
provides clients with failover property. See Using Sybase Failover in a High Availability System for more information.
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.
The 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.
specifies the network packet size to use for this isql session. For example, the following sets the packet size to 2048 bytes for this isql session:
isql -A 2048
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.
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.
selects the database in which the isql session begins.
specifies an editor other than the default editor vi.
specifies the number of rows to print between column headings. The default prints headings only once for each set of query results.
sets the client host name.
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.
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.
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. F or more information about character sets and the associated flags, see Chapter 20, “Configuring Client/Server Character Set Conversions,” in the System Administration Guide. The default character sets for different platforms are:
Platform |
Default character set |
---|---|
Sun Solaris, Digital UNIX, Pyramid, NCR, RS/6000 |
iso_1 |
HP-UX |
roman8 |
OS/2, Novell NetWare 386 |
cp850 |
Macintosh |
mac |
specifies the path to the keytab file used for authentication in DCE.
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.
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.
specifies the name of an operating system file to store the output from isql. Specifying the parameter as -o outputfile is similar to > outputfile
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.
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.
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.
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.
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.
specifies a login name. Login names are case sensitive.
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.
-V can be followed by 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
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.
is 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 or the sp_addlanguage stored procedure.
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/Server Configuration Guide.
This example 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
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
Specifies that you are running isql from a Macintosh against a server that is using the roman8 character set:
isql -a mac -J roman8
Use this syntax for isql_r if you are using threaded drivers.
Use this syntax for isql_dce if you are using threaded drivers in the IBM platform.
You must set the SYBASE environment variable to the location of the current version of Adaptive Server before you can use isql.
The 5701 (“changed database”) server message is no longer displayed after login or issuing a use database command.
Error message format differs from earlier versions of isql. If you have scripts that perform routines based on the values of these messages you may need to rewrite them.
To use isql interactively, give the command isql (and any of the optional parameters) at your operating system prompt. The isql program accepts SQL commands and sends them to Adaptive Server. The results are formatted and printed on standard output. Exit isql with quit or exit.
Terminate a command by typing a line beginning with the default command terminator go or another command terminator, if the -c parameter is used. You can follow the command terminator with an integer to specify how many times to run the command. For example, to execute this command 100 times, type:
select x = 1 go 100
The results display once at the end of execution.
If you enter an option more than once on the command line, isql uses the last value. For example, if you enter the following command, “send”, the second value for -c, overrides “.”, the first value:
isql -c"." -csend
This enables you to override any aliases you set up.
To call an editor on the current query buffer, enter its name as the first word on a line. Define your preferred callable editor by specifying it with the EDITOR environment variable. If EDITOR is not defined, the default is vi.
Execute operating system commands by starting a line with “!!” followed by the command. Call alternate editors this way, without defining EDITOR.
To clear the existing query buffer, type reset on a line by itself. isql discards any pending input. You can also press Ctrl-c anywhere on a line to cancel the current query and return to the isql prompt.
Read in an operating system file containing a query for execution by isql as follows:
isql -U alma -Ppassword < input_file
The file must include a command terminator. The results appear on your terminal. Read in an operating system file containing a query and direct the results to another file as follows:
isql -U alma -Ppassword < input_file > output_file
Case is significant for the isql flags.
isql displays only 6 digits of float or real data after the decimal point, rounding off the remainder.
When you are using isql interactively, read an operating system file into the command buffer with the command:
:r filename
Do not include the command terminator in the file; once you have finished editing, enter the terminator interactively on a line by itself.
You can include comments in a Transact-SQL statement submitted to Adaptive Server by isql. Open a comment with “/*”. Close it with “*/”, as shown in the following example:
select au_lname, au_fname /*retrieve authors’ last and first names*/ from authors, titles, titleauthor where authors.au_id = titleauthor.au_id and titles.title_id = titleauthor.title_id /*this is a three-way join that links authors **to the books they have written.*/
If you want to comment out a go command, it should not be at the beginning of a line. For example, use the following to comment out the go command:
/* **go */
Do not use the following:
/* go */
See Chapter 2, “Using the isql Utility” for details on isql.
See the Reference Manual for more information regarding default network packet size and maximum network packet size configuration parameters.
Commands – create schema, set
Datatype – exact numeric datatypes
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