.\" Text automatically generated by txt2man-1.4.5 .TH FreeTDS "February 24, 2006" "0.64RC1" "FreeTDS Utilities" .SH NAME \fBbsqldb \fP- batch SQL script processor using db-lib \fB .SH SYNOPSIS .nf .fam C \fBbsqldb\fP [-U \fIusername\fP] [-P \fIpassword\fP] [-S \fIserver\fP] [-D \fIdatabase\fP] [-i \fIinput_file\fP] [-o \fIoutput_file\fP] [-e \fIerror_file\fP] [-t \fIfield_term\fP] [-qv] .fam T .fi .SH DESCRIPTION \fBbsqldb\fP is a utility program distributed with FreeTDS. .PP \fBbsqldb\fP is a non-interactive equivalent of the "isql" utility programs distributed by Sybase and Microsoft. Like them, \fBbsqldb\fP uses the command "go" on a line by itself as a separator between batches. The last batch need not be followed by "go". .PP \fBbsqldb\fP makes use of the db-lib API provided by FreeTDS. This API is of course also available to application developers. .SH OPTIONS .TP .B -U \fIusername\fP Database \fIserver\fP login name. .TP .B -P \fIpassword\fP Database \fIserver\fP \fIpassword\fP. .TP .B -S \fIserver\fP Database \fIserver\fP to which to connect. .TP .B -D \fIdatabase\fP Database to use. .TP .B -i \fIinput_file\fP Name of script file, containing SQL. .TP .B -o \fIoutput_file\fP Name of output file, holding result data. .TP .B -e \fIerror_file\fP Name of file for errors. .TP .B -t \fIfield_term\fP Specifies the field terminator. Default is two spaces (' '). Recognized escape sequences are tab ('\\t'), carriage return ('\\r'), newline ('\\n'), and backslash ('\\\\'). .TP .B -q Do not print column metadata, return status, or rowcount. .TP .B -v Verbose mode, for more information about the db-lib interaction. This also reports the result set metadata, including and return code. All verbose data are written to standard error (or -e), so as not to interfere with the data stream. .SH NOTES \fBbsqldb\fP is a filter; it reads from standard input, writes to standard output, and writes errors to standard error. The -i, -o, and -e options override these, of course. .PP The source code for \fBbsqldb\fP is intended as a model for db-lib users. db-lib has a rich set of functions, and it can be hard sometimes to understand how to use them, particularly the first time. If you are using it in this way and find something unclear, you are encouraged to email the author your comments. .SS .SH EXIT STATUS \fBbsqldb\fP exits 0 on success, and >0 if the \fIserver\fP cannot process the query. .PP \fBbsqldb\fP will report any errors returned by the \fIserver\fP, but will continue processing. In a production environment, this behavior may be insufficiently stringent. To make it extremely intolerant of errors, change the message and error handlers to call \fBexit\fP(3). .SH HISTORY \fBbsqldb\fP first appeared in FreeTDS 0\.63. .SH AUTHORS The \fBbsqldb\fP utility was written by James K. Lowden .SH BUGS Microsoft servers as of SQL Server 7.0 SP 3 do not return output parameters unless the RPC functions are used. This means \fBbsqldb\fP cannot return output parameters for stored procedures with these servers.