1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
.\" cf. groff_mdoc
.Dd March 25, 2015
.Os FreeTDS @VERSION@
.Dt BSQLODBC FreeTDS "FreeTDS Reference Manual"
.\"
.Sh NAME
.Nm bsqlodbc
.Nd batch SQL script processor using ODBC
.\"
.Sh SYNOPSIS
.Pp
.Nm
.Op Fl hqv
.Op Fl U Ar username
.Op Fl P Ar password
.Op Fl S Ar server
.Op Fl D Ar database
.Op Fl i Ar input_file
.Op Fl o Ar output_file
.Op Fl e Ar error_file
.Op Fl t Ar field_term
.Op Fl V Ar odbc_version
.\"
.Sh DESCRIPTION
.Pp
.Nm
is a utility program distributed with FreeTDS.
.Pp
.Nm
is a non-interactive equivalent of the
.Ql isql
utility programs distributed by Sybase and Microsoft. Like them,
.Nm
uses the command
.Ql go
on a line by itself as a separator between batches. The last
batch need not be followed by
.Ql go .
.Pp
.Nm
makes use of the ODBC API provided by FreeTDS. This
API is of course also available to application developers.
.\"
.Sh OPTIONS
.Bl -tag -width indent
.It Fl U Ar username
Database server login name.
.It Fl P Ar password
Database server password.
.It Fl S Ar server
Database server to which to connect.
.It Fl D Ar database
Database to use.
.It Fl i Ar input_file
Name of script file, containing SQL.
.It Fl o Ar output_file
Name of output file, holding result data.
.It Fl e Ar error_file
Name of file for errors.
.It Fl t Ar field_term
Specifies the field terminator. Default is two spaces (
.Ql \ \
.Ns ).
Recognized escape sequences are tab (
.Ql \et
.Ns ),
carriage return (
.Ql \er
.Ns ),
newline (
.Ql \en
.Ns ),
and backslash (
.Ql \e\e
.Ns ).
.It Fl h
Print column headers with the data to the same file.
.It Fl q
Do not print column metadata, return status, or rowcount. Overrides
.Fl h .
.It Fl v
Verbose mode, for more information about the ODBC interaction.
This also reports the result set metadata, including and return code. All
verbose data are written to standard error (or
.Fl e Ns ),
so as not to interfere with the data stream.
.It Fl V Ar odbc_version
Specify ODBC version (2 or 3).
.El
.\"
.Sh NOTES
.Pp
.Nm
is a filter; it reads from standard input, writes to standard output,
and writes errors to standard error. The
.Fl i ,
.Fl o ,
and
.Fl e
options override these defaults.
.Sh EXIT STATUS
.Nm
exits 0 on success, and >0 if the server cannot process the query.
.\"
.Sh HISTORY
.Nm
first appeared in FreeTDS 0.65.
.\"
.Sh AUTHORS
The
.Nm
utility was written by
.An James K. Lowden Aq jklowden@freetds.org .
|