1FreeTDS(February 24, 2006) FreeTDS(February 24, 2006)
2
3
4
6 bsqldb - batch SQL script processor using db-lib
7
9 bsqldb [-U username] [-P password] [-S server] [-D database]
10 [-i input_file] [-o output_file] [-e error_file]
11 [-t field_term] [-qv]
12
14 bsqldb is a utility program distributed with FreeTDS.
15
16 bsqldb is a non-interactive equivalent of the "isql" utility programs
17 distributed by Sybase and Microsoft. Like them, bsqldb uses the command
18 "go" on a line by itself as a separator between batches. The last batch
19 need not be followed by "go".
20
21 bsqldb makes use of the db-lib API provided by FreeTDS. This API is of
22 course also available to application developers.
23
25 -U username
26 Database server login name.
27
28 -P password
29 Database server password.
30
31 -S server
32 Database server to which to connect.
33
34 -D database
35 Database to use.
36
37 -i input_file
38 Name of script file, containing SQL.
39
40 -o output_file
41 Name of output file, holding result data.
42
43 -e error_file
44 Name of file for errors.
45
46 -t field_term
47 Specifies the field terminator. Default is two spaces (' ').
48 Recognized escape sequences are tab ('\t'), carriage return
49 ('\r'), newline ('\n'), and backslash ('\\').
50
51 -q Do not print column metadata, return status, or rowcount.
52
53 -v Verbose mode, for more information about the db-lib interaction.
54 This also reports the result set metadata, including and return
55 code. All verbose data are written to standard error (or -e), so
56 as not to interfere with the data stream.
57
59 bsqldb is a filter; it reads from standard input, writes to standard
60 output, and writes errors to standard error. The -i, -o, and -e options
61 override these, of course.
62
63 The source code for bsqldb is intended as a model for db-lib users. db-
64 lib has a rich set of functions, and it can be hard sometimes to under‐
65 stand how to use them, particularly the first time. If you are using it
66 in this way and find something unclear, you are encouraged to email the
67 author your comments.
68
69
71 bsqldb exits 0 on success, and >0 if the server cannot process the
72 query.
73
74 bsqldb will report any errors returned by the server, but will continue
75 processing. In a production environment, this behavior may be insuffi‐
76 ciently stringent. To make it extremely intolerant of errors, change
77 the message and error handlers to call exit(3).
78
80 bsqldb first appeared in FreeTDS 0.63.
81
83 The bsqldb utility was written by James K. Lowden <jklowden@schemama‐
84 nia.org>
85
87 Microsoft servers as of SQL Server 7.0 SP 3 do not return output param‐
88 eters unless the RPC functions are used. This means bsqldb cannot
89 return output parameters for stored procedures with these servers.
90
91
92
93FreeTDS Utilities 0.64RC1 FreeTDS(February 24, 2006)