Blame SOURCES/isql.1

5a0433
.TH isql 1 "Tue 25 Jun 2013" "version 2.3.1" "UnixODBC manual pages"
5a0433
5a0433
.SH NAME
5a0433
isql, iusql \- unixODBC command-line interactive SQL tool
5a0433
5a0433
.SH SYNOPSIS
5a0433
\fBisql\fR \fIDSN\fR [\fIUSER\fR [\fIPASSWORD\fR]] [\fIoptions\fR] 
5a0433
5a0433
.SH DESCRIPTION
5a0433
.B isql
5a0433
is a command line tool which allows the user to execute SQL in batch
5a0433
or interactively. It has some interesting options such as an option to generate
5a0433
output wrapped in an HTML table.
5a0433
5a0433
.B iusql
5a0433
is the same tool with built-in Unicode support.
5a0433
5a0433
.SH ARGUMENTS
5a0433
5a0433
.IP \fBDSN\fR
5a0433
The Data Source Name, which should be used to make connection to the database.
5a0433
The data source is looked for in the /etc/odbc.ini and $HOME/.odbc.ini files in
5a0433
that order, with the latter overwriting the former.
5a0433
5a0433
.IP \fBUSER\fR
5a0433
Specifies the database user/role under which the connection should be made.
5a0433
5a0433
.IP \fBPASSWORD\fR
5a0433
Password for the specified \fBUSER\fR.
5a0433
5a0433
.SH OPTIONS
5a0433
5a0433
.IP \fB-b\fR
5a0433
Run isql in non-interactive batch mode. In this mode, the isql processes its
5a0433
standard input, expecting one SQL command per line.
5a0433
5a0433
.IP \fB-d\fIDELIMITER\fR
5a0433
Delimits columns with \fIdelimiter\fR.
5a0433
5a0433
.IP \fB-x\fIHEX\fR
5a0433
Delimits columns with \fIHEX\fR, which is a hexadecimal code of the delimiting
5a0433
character in the format 0xNN - i.e. 0x09 for the TAB character.
5a0433
5a0433
.IP \fB-w\fR
5a0433
Format the result as HTML table.
5a0433
5a0433
.IP \fB-c\fR
5a0433
Output the names of the columns on the first row. Has any effect only with the
5a0433
\fB-d\fR or \fB-x\fR options.
5a0433
5a0433
.IP \fB-m\fINUM\fR
5a0433
Limit the column display width to \fINUM\fR characters.
5a0433
5a0433
.IP \fB-l\fILOCALE\fR
5a0433
Sets locale to \fILOCALE\fR.
5a0433
5a0433
.IP \fB-q\fR
5a0433
Wrap the character fields in double quotes.
5a0433
5a0433
.IP \fB-3\fR
5a0433
Use the ODBC 3 calls.
5a0433
5a0433
.IP \fB-n\fR
5a0433
Use the newline processing.
5a0433
5a0433
.IP \fB-e\fR
5a0433
Use the SQLExecDirect instead of Prepare.
5a0433
5a0433
.IP \fB-k\fR
5a0433
Use SQLDriverConnect.
5a0433
5a0433
.IP \fB-v\fR
5a0433
Turn on the verbose mode, where the errors are fully described. Useful for debugging.
5a0433
5a0433
.IP \fB--version\fR
5a0433
Prints the program version and exits.
5a0433
5a0433
.SH COMMANDS
5a0433
This section briefly describes some isql runtime commands.
5a0433
5a0433
.B help
5a0433
.RS
5a0433
List all tables in the database.
5a0433
.RE
5a0433
5a0433
.B help \fItable\fR
5a0433
.RS
5a0433
List all columns in the \fItable\fR.
5a0433
.RE
5a0433
5a0433
.B help help
5a0433
.RS
5a0433
List all help options.
5a0433
.RE
5a0433
5a0433
.SH EXAMPLES
5a0433
.nf
5a0433
$ isql WebDB MyID MyPWD -w -b < My.sql
5a0433
.fi
5a0433
5a0433
Connects to the WebDB as user MyID with password MyPWD, then execute the
5a0433
commands in the My.sql file and returns the results wrapped in HTML table.
5a0433
Each line in My.sql must contain exactly 1 SQL command, except for the last
5a0433
line, which must be blank (unless the \fB-n\fR option is specified).
5a0433
5a0433
.SH FILES
5a0433
5a0433
.I /etc/odbc.ini
5a0433
.RS
5a0433
System-wide DSN definitions. See
5a0433
.BR odbc.ini (5)
5a0433
for details.
5a0433
.RE
5a0433
5a0433
.I $HOME/.odbc.ini
5a0433
.RS
5a0433
User-specific DSN definitions. See
5a0433
.BR odbc.ini (5)
5a0433
for details.
5a0433
.RE
5a0433
5a0433
.SH SEE ALSO
5a0433
.BR odbcinst (1),
5a0433
.BR odbc.ini (5)
5a0433
5a0433
.SH AUTHORS
5a0433
5a0433
The authors of unixODBC are Peter Harvey <\fIpharvey@codebydesign.com\fR> and
5a0433
Nick Gorham <\fInick@easysoft.com\fR>. For the full list of contributors see the
5a0433
AUTHORS file.
5a0433
5a0433
.SH COPYRIGHT
5a0433
5a0433
unixODBC is licensed under the GNU Lesser General Public License. For details
5a0433
about the license, see the COPYING file.