eaiovnaovbqoebvqoeavibavo man5/freetds.conf.5000064400000014500147633110370010057 0ustar00.Dd May 2, 2017 .Os FreeTDS 1.4.9 .Dt FREETDS.CONF "FreeTDS 5" "FreeTDS Reference Manual" . .Sh NAME .Nm freetds.conf .Nd configuration file for FreeTDS . .Sh SYNOPSIS The .Pa freetds.conf file describes Sybase and Microsoft database servers to the FreeTDS library. It comprises sections headed by a servername, followed by a list of connection properties denoted as name-value pairs. Defaults are defined via a .Bq global section. This file supersedes the .Pa interfaces file that Sybase defines for the same purpose, although the latter is still supported. . .Sh DESCRIPTION A section begins with a servername \(em the name of the server \(em in square brackets. The servername is chosen at the client's descretion. (One exception: with Sybase ASA the servername must match the database name to be used.) .Pp Sections contain properties, one per line, in the form .Pp .Dl name = value .Pp where .Ar name is the connection property to be described. Servernames and properties are not case sensitive. Values are case-preserving i.e., copied literally. Comments begin with either a semicolon .Pq So ; Sc or pound sign .Pq So # Sc and continue to end of line. Blank lines are ignored. Whitespace surrounding the .So = Sc is ignored. . .Sh PROPERTIES .Bl -tag -width "emulate little endian" -compact . .It client charset encoding of client data; overrides locale(1) settings .Bl -tag -width "default:" -compact .It Domain: iconv character set names .It Default: ISO-8859-1 .El . .It connect timeout seconds to wait for response from connect request .Bl -tag -width "default:" -compact .It Domain: 0 to MAX_INT .It Default: none .El . .It debug flags logging granularity .Bl -tag -width "default:" -compact .It Domain: 32-bit integer .It Default: 0x4fff .El . .It dump file specifies location of a logfile and turns on logging .Bl -tag -width "default:" -compact .It Domain: valid file name .It Default: none .El . .It dump file append log data appended to file instead of re-writing for each connection .Bl -tag -width "default:" -compact .It Domain: yes/no .It Default: no .El . .It emulate little endian forces big endian machines to act as little endian to communicate with Microsoft Servers .Bl -tag -width "default:" -compact .It Domain: yes/no .It Default: no .El . .It encryption .Bl -tag -compact .It Em off disables encryption .It Em request use if available (default when tds version greater than 7.0) .It Em required allow encrypted connections only .El . .It host Name of the host the server is running on. .Bl -tag -width "default:" -compact .It Domain: host name or IP address .It Default: SYBASE .El . .It initial block size maximum size of a protocol block .Bl -tag -width "default:" -compact .It Domain: multiple of 512 .It Default: 512 .El . .It instance name of Microsoft SQL Server instance to connect to (supersedes .Em port ) .Bl -tag -width "default:" -compact .It Domain: instance name .It Default: none .El . .It port port number that the server is listening to .Bl -tag -width "default:" -compact .It Domain: any valid port .It Default: TDS 5.0, 5000; TDS 7.0 and up, 1433 .El . .It tds version TDS protocol version to use .Bl -tag -width "default:" -compact .It Domain: 4.2, 5.0, 7.0, 7.1, 7.2 .It Default: .Fl -with-tdsver value (5.0 if unspecified) .El . .It text size default value of TEXTSIZE, in bytes .Bl -tag -width "default:" -compact .It Domain: 0 to 4,294,967,295 .It Default: 4,294,967,295 .El . .It timeout seconds to wait for response to a query .Bl -tag -width "default:" -compact .It Domain: 0 to MAX_INT .It Default: none (wait forever) .El . .El .Pp Do not define both .Fa port and .Fa instance Ns \&. One implies the other. .Pp Boolean property values may be denoted as on/off, true/false, or 1/0. . .Ss DEBUG FLAGS The log's granularity can be controlled with the .Em debug flags property. .Bl -column -offset indent ".Sy 0x8000" ".Sy show source level info (source file and line)" .It Sy Value Ta Sy Meaning .It Li \ \ 0x02 severe error .It Li \ \ 0x04 error .It Li \ \ 0x08 warning .It Li \ \ 0x10 network .It Li \ \ 0x20 information level 1 .It Li \ \ 0x40 information level 2 .It Li \ \ 0x80 function trace and info .It Li 0x1000 show pid .It Li 0x2000 show time .It Li 0x4000 show source level info (source file and line) .It Li 0x8000 thread id (not implemented). .El . .Sh NAMES AND LOCATIONS The file is normally named .Pa /etc/freetds.conf or .Pa ${HOME}/.freetds.conf . That name can be overridden with the FREETDSCONF environment variable. .Pp FreeTDS will search conf files for a servername in the following order: .Bl -enum -offset indent -compact .It a filename set programatically via dbsetifile() that is in .conf format .It a filename in the environment variable FREETDSCONF that is in .conf format .It .Pa ${HOME}/.freetds.conf if extant .It .Pa /opt/cpanel/freetds/etc/freetds.conf .El .Pp The search stops with the first file containing the servername. .Pp If no conf file is found, FreeTDS searches for an .Pa interfaces file in the following order: .Bl -enum -offset indent -compact .It a filename set programatically via dbsetifile() that is in .Pa interfaces format .It .Pa ${HOME}/.interfaces .It .Pa $SYBASE/interfaces (where .Ev $SYBASE is an environment variable) .El .Pp If the requested servername is not found in any configuration file, the fallback mechanism is: .Bl -enum -offset indent -compact .It attempt to convert the name to an IP address with inet_addr(3), else .It attempt to convert the name to an IP address with gethostbyname(3), else .It attempt to look up the literal name .Dq SYBASE .El . .Sh ENVIRONMENT .Bl -tag -width "TDSDUMPCONFIG" -compact .It Ev FREETDSCONF overrides name and location of the system-wide conf file .It Ev TDSDUMP overrides the name and location of the FreeTDS log file .It Ev TDSDUMPCONFIG specifies a name and location of a file that logs the search of configuration files .It Ev TDSHOST overrides the host property .It Ev TDSPORT overrides the port property .It Ev TDSQUERY synonym for DSQUERY, the default servername .It Ev TDSVER overrides the version specified in the freetds.conf .El .Pp The environment variables .Ev TDSVER, Ev TDSDUMP, Ev TDSPORT, Ev TDSQUERY, and Ev TDSHOST override values set by a .conf or .Pa interfaces file. . .Sh FILES .Pa /opt/cpanel/freetds/etc/freetds.conf , ${HOME}/.freetds.conf . .Sh SEE ALSO .%B FreeTDS User Guide . .Sh HISTORY \.conf files first appeared with version 0.53 of FreeTDS. man1/bsqlodbc.1000064400000004517147633110370007267 0ustar00.\" cf. groff_mdoc .Dd March 25, 2015 .Os FreeTDS 1.4.9 .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 . man1/bsqldb.1000064400000006666147633110370006754 0ustar00.\" cf. groff_mdoc .Dd March 26, 2015 .Dt BSQLDB 1 .Os FreeTDS 1.4.9 .Sh NAME .Nm bsqldb .Nd batch SQL script processor using DB-Library .Sh SYNOPSIS .Nm .Op Fl hqv .Op Fl S Ar servername .Op Fl D Ar database .Op Fl U Ar username .Op Fl P Ar password .Op Fl i Ar input_file .Op Fl o Ar output_file .Op Fl e Ar error_file .Op Fl H Ar hostname .Op Fl t Ar field_term .Op Fl R Ar pivot_description .\" .Sh DESCRIPTION .Nm is a utility program distributed with FreeTDS. .Nm is a non-interactive equivalent of the "isql" utility programs distributed by Sybase and Microsoft. Like them, .Nm uses the command "go" on a line by itself as a separator between batches. The last batch need not be followed by "go". .Nm makes use of the DB-Library API provided by FreeTDS. This API is of course also available to application developers. .Sh OPTIONS .Bl -tag -width indent .It Fl D Ar database Database to use. .It Fl H Ar hostname hostname Override name of client sent to server. .It Fl P Ar password Database server password. .It Fl S Ar servername Database server to which to connect. .It Fl U Ar username Database server login name. If username is not provided, a domain login is attempted for TDS 7+ connections. .It Fl e Ar error_file Name of file for errors. .It Fl h Print column headers with the data to the same file. .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 q Do not print column metadata, return status, or rowcount. Overrides .Fl h Ns . .It Fl t Ar field_term Specifies the field terminator. Default is two spaces (' '). Recognized escape sequences are tab ('\\t'), carriage return ('\\r'), newline ('\\n'), and backslash ('\\\\'). .It Fl v Verbose mode, for more information about the DB-Library 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 R Ar pivot_description Specify pivot trasformation. The format is .Ao Ar down\ columns Ac .Ao Ar across\ columns Ac .Ao Ar function Ac .Ao Ar value Ac . Columns are specified but numbers. The format of .Ar down columns and .Ar across columns is a comma separated list of columns. .Ar function is either count, sum, min or max. .El .\" .Sh ENVIRONMENT .Ev DSQUERY default .Ar servername .\" .Sh NOTES .Nm is a filter; it reads from standard input, writes to standard output, and writes errors to standard error. The .Fl i Ns , Fl o Ns , and Fl e options override these defaults. .Pp The source code for .Nm is intended as a model for DB-Library users. DB-Library has a rich set of functions, and it can be hard sometimes to understand how to use them, particularly the first time. If you find something about the source code unclear, you are encouraged to email the author your comments. .\" .Sh EXIT STATUS .Nm exits 0 on success, and >0 if the server cannot process the query. .Pp For messages with severity > 10, .Nm calls exit(3) with the severity level. For example, if the severity level is 16, .Nm will return an exit status of 16 to the shell. .\" .Sh HISTORY .Nm first appeared in FreeTDS 0.63. .\" .Sh AUTHORS The .Nm utility was written by .An "James K. Lowden" Aq jklowden@freetds.org . .\" .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 .Nm cannot return output parameters for stored procedures with these servers. man1/fisql.1000064400000010070147633110370006603 0ustar00.\" cf. groff_mdoc .Dd March 25, 2015 .Os FreeTDS 1.4.9 .Dt FISQL FreeTDS "FreeTDS Reference Manual" .\" .Sh NAME .Nm fisql .Nd interactive SQL shell .\" .Sh SYNOPSIS .Pp .Nm .Op Fl eFgpnvXY .Op Fl a Ar display_charset .Op Fl A Ar packet_size .Op Fl c Ar cmdend .Op Fl D Ar database .Op Fl E Ar editor .Op Fl h Ar headers .Op Fl H Ar hostname .Op Fl i Ar inputfile .Op Fl I Ar interfaces_file .Op Fl J Ar client_charset .Op Fl l Ar login_timeout .Op Fl m Ar errorlevel .Op Fl o Ar outputfile .Op Fl P Ar password .Op Fl s Ar colseparator .Op Fl S Ar server .Op Fl t Ar timeout .Op Fl U Ar username .Op Fl w Ar width .Op Fl y Ar sybase_dir .Op Fl z Ar language .\" .Sh DESCRIPTION .Pp .Nm is very similar to 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. .\" .Sh OPTIONS .Bl -tag -width indent .It Fl a Ar display_charset The client charset name. Not implemented. .It Fl A Ar packet_size Set protocol packet size. You should not need to set this parameter. .It Fl c Ar cmdend Command terminator, defaults to .Ql go Ns . .It Fl D Database name on the server to use. .It Fl e Echo SQL input (usually in outputfile) .It Fl E Ar editor Specify an editor to invoke. Defaults to vi. .It Fl F FIPS mode ON. Server returns a message (but processes the query anyway) when it encounters a non-standard SQL command. .It Fl g Display a brief help message .It Fl h Ar headers Number of rows after which to repeat the column headers. Default is once per resultset. .It Fl H Ar hostname Hostname of the client machine as it will be told to the server. .It Fl I Ar interfaces_file Name of the interfaces or freetds.conf file to use. .It Fl i Ar inputfile Name of script file, containing SQL. .It Fl J Ar client_charset Not implemented. .It Fl l Ar login_timeout How long to wait for the server to acknowledge a login attempt. .It Fl m Ar errorlevel For errors of the severity level specified or higher, print only the message number, state, and error level. Below that level, print nothing. .It Fl n Suppress line numbers in echoed output. .It Fl o Ar outputfile Name of output file, holding result data. .It Fl p Prints performance statistics. Not implemented. .It Fl P Ar password Database server password. .It Fl s Ar colseparator The column separator. Default is space. Shell metacharacters require quoting. .It Fl S Ar server Database server to which to connect. .It Fl t Ar timeout The query timeout, in seconds. How long to wait for a query to be processed. The default is indefinitely, or as determined by freetds.conf. .It Fl U Ar username Database server login name. .It Fl v Display version and copyright. .It Fl w Ar width How many characters wide to print the output. Defaults to 80. .It Fl X Use encrypted login. Not implemented in FreeTDS. .It Fl y Pa sybase_dir Sets the .Ev SYBASE environment variable. Not used by FreeTDS. .It Fl Y Use chained transactions. .It Fl z Ar language Name of a language for fisql's prompts and messages. Cf. DBSETLNATLANG. .El .\" .Sh NOTES .Nm is a filter; it reads from standard input, writes to standard output, and writes errors to standard error. The .Fl i Ns , .FL o Ns , and .Fl e options override these defaults. .Pp .Nm uses the DB-Library API provided by FreeTDS. It was first implemented using Sybase's own library and continues to work with it. Before (and after) modifying it, it would be well to test it with Sybase's library to assure compatibility between it and FreeTDS. EXIT STATUS .Pp .Nm exits 0 on success, and >0 if the server cannot process the query. .Pp .Nm will report any errors returned by the server, 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 exit(3). .\" .Sh HISTORY .Nm first appeared in FreeTDS 0.65. .\" .Sh AUTHORS The .Nm utility was written by .An Nicholas S. Castellano Aq entropy@freetds.org Ns , who contributed it to the FreeTDS project under the terms of the GPL. .\" .Sh BUGS Requires the GNU readline library. man1/datacopy.1000064400000004557147633110370007306 0ustar00.\" cf. groff_mdoc .Dd March 25, 2015 .Os FreeTDS 1.4.9 .Dt DATACOPY FreeTDS "FreeTDS Reference Manual" .\" .Sh NAME .Nm datacopy .Nd move table data between two servers .\" .Sh SYNOPSIS .Nm .Op Fl vdE .Bro .Fl t | .Fl a | .Fl c .Ar owner .Brc .Op Fl b Ar batchsize .Op Fl p Ar packetsize .Op Fl S Ar server/username/password/database/table_or_view .Op Fl D Ar server/username/password/database/table .Op Fl T Ar textsize .\" .Sh DESCRIPTION .Nm is a utility distributed with FreeTDS. .Nm will move table data from one server to another without the need for intermediate files. .Nm is much faster and more efficient than is freebcp out/in. .Pp .Nm makes use of the db-lib bcp API built into FreeTDS. This API is also available to application developers. .Pp .Nm can be used to migrate data between Sybase ASE and SQL Server or vice versa. .\" .Sh OPTIONS .Bl -tag -width indent .It Fl t Truncate target table before loading data. .It Fl a Append data to target table. .It Fl c Ar owner Create the target table with the same schema as the source table. .Nm will submit a .Ql CREATE TABLE command on the target server using the specified owner in the command, e.g. .Ql CREATE TABLE owner.table (.\|.\|.\&). .It Fl b Ar batchsize The number of rows per batch of data copied. Each batch of data is effectively 'committed' to the database. The default is 1000. .It Fl p Ar packetsize The number of bytes, per network packet, sent to and from the servers. Increased packet size can enhance performance. .It Fl T Ar textsize Specify size of TEXT/IMAGE column from network. .It Fl v Produce verbose output, including diagnostic timings. .It Fl d Produce freetds TDSDUMP output. (Serious debug only!) .It Fl S Ar server/username/password/database/table_or_view The connection information for the source server and the location/name of the table (or view) to be copied. If not specified, .Nm prompts the user for the information. .It Fl D Ar server/username/password/database/table The connection information for the destination server and the location/name of the target table. If not specified, .Nm prompts the user for the information. .It Fl E Keep identity values. .Sh SEE ALSO .Xr freebcp 1 , Xr defncopy 1 , Xr bsqldb 1 , Xr tsql 1 , .%B FreeTDS User Guide. .\" .Sh HISTORY .Pp .Nm first appeared in FreeTDS 0.64. .\" .Sh AUTHORS The .Nm utility was written by .An Bill Thompson Aq thompbil@exchange.uk.ml.com . man1/tsql.1000064400000006633147633110370006462 0ustar00.\" cf. groff_mdoc .Dd March 25, 2015 .Os FreeTDS 1.4.9 .Dt TSQL FreeTDS "FreeTDS Reference Manual" .Sh NAME .Nm tsql .Nd utility to test FreeTDS connections and queries .Sh SYNOPSIS .Nm .Bro .Fl S Ar servername .Op Fl I Ar interface | .Fl H Ar hostname .Op Fl L .Op Fl p Ar port .Brc .Op Fl D Ar dbname .Op Fl U Ar username .Op Fl P Ar password .Op Fl o Ar options .Nm .Fl C .Sh DESCRIPTION .Nm is a FreeTDS diagnostic tool. It uses the TDS protocol to connect to a Sybase or Microsoft SQL Server, and lets the user issue queries. .Nm does not use the FreeTDS client libraries. Instead, it uses only the lowest level library, libtds, to test the protocol implementation. .Pp .Nm can be run in two ways, one which uses the freetds.conf and one which connects directly using the server's hostname and port. The .Fl H and .Fl p parameters are provided to let the user verify a server is listening on the named host and port. These parameters override any configuration files and environment variables. .Pl The .Fl S parameter can be used to test the local configuration. FreeTDS will use freetds.conf (or equivalent) and environment variables in the normal way to determine the server's IP address and port. You can use .Fl I to specify a filename, overriding FreeTDS's configuration file search algorithm. .Sh OPTIONS .Bl -tag -width indent .It Fl S Ar servername database server to which to connect. .It Fl D Ar dbname database to use. .It Fl I Ar interface freetds.conf or interfaces file describing servername. .It Fl H Ar hostname DNS hostname of the server. .It Fl p Ar port port at which SQL Server is listening. .It Fl U Ar username database login name. If username is not provided, a domain login is attempted for TDS 7+ connections. .It Fl P Ar password database password. .It Fl L list Microsoft server instances (with .Fl H Ns ). .It Fl C print some of the compile-time configuration parameters. .It Fl o Ar options apply the options specified to every command. .Bl -tag -width indent .It Fl f No footer .Bq result count .It Fl h No header .Bq titles .It Fl t Print time .It Fl v Print version .It Fl q Quiet .El .It Fl a Ar appname application name. .It Fl t Ar colterm column terminator. .It Fl r Ar rowterm row terminator. .It Fl r Ar rowterm row terminator. .It Fl J Ar charset character set. .It Fl v verbose mode. .El .\" .Sh NOTES If you can connect with .Ql tsql -S servername Ns , your basic FreeTDS installation is working. .Pp Typing .Ql exit Ns , .Ql quit Ns , or .Ql bye (or .Li ^D Ns ) exits .Nm Ns . .Pp Typing .Ql version displays the TDS protocol version. .Pp Command batches may be separated with .Ql go or .Ql GO Ns . If .Ql GO the version string is reported before executing the batch. .Pp After prompting for the password (if not provided with .Fl P Ns ), .Nm will attempt to connect to the remote server. .Nm displays a counter indicating the number of seconds elapsed during the connection attempt. Typically, .Nm immediately responds with a .Ql 1> prompt. If you see the counter (1, 2, 3, ...), most likely .Nm is unable to connect to the indicated server. .Pp .Nm is not a replacement for a complete isql such as sqsh (www.sqsh.org). If you have suggestions for ways to make .Nm more useful as a diagnostic tool, please post them to the FreeTDS mailing list for consideration. .Sh HISTORY .Nm first appeared in FreeTDS 0.60. .Sh AUTHORS The .Nm utility was written by .An Brian Bruns Ns . .Sh BUGS Several, to be sure, now that it's documented. :) man1/defncopy.1000064400000005073147633110370007303 0ustar00.\" cf. groff_mdoc .Dd April 26, 2012 .Os FreeTDS 1.4.9 .Dt DEFNCOPY FreeTDS "FreeTDS Reference Manual" .\" .Sh NAME .Nm defncopy .Nd extract procedures and views from a Microsoft server. .\" .Sh SYNOPSIS .Pp .Nm .Op Fl v .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 .Bo .Ar owner.object_name .\" Elipsis according to Werner Lemberg: .\" http://www.mail-archive.com/groff@gnu.org/msg03122.html .Op Ar owner.object_name .\|.\|.\& .Bc .\" .Sh DESCRIPTION .Pp .Nm is a utility program distributed with FreeTDS. It replaces a similar program of the same name distributed by Sybase. .Pp .Nm reads the text of a stored procedure or view, and writes a script suitable for recreating the procedure or view. For tables, it reads the output of sp_help and constructs a .Ql CREATE TABLE statement, complete with .Ql CREATE INDEX Ns , too. .\" .Ar owner is optional if you or the database owner is the owner of the procedure/view being copied. .Ar object_name is the name of the system object you wish to extract. .\" .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. Optional if the procedure/view being extracted is in your default database. .It Fl i Ar input_file a script to apply to the database. Not currently implemented. .It Fl o Ar output_file a file to hold the script, defaults to standard output. .It Fl v Show version information and copyright notice. .El .\" .Sh NOTES .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. .Pp .Nm makes use of the db-lib API provided by FreeTDS. This API is of course also available to application developers. .Sh EXIT STATUS .Pp .Nm exits 0 on success, and >0 if the server cannot process the query. .Pp .Nm will report any errors returned by the server, but will continue processing. .\" .Sh HISTORY .Pp .Nm first appeared in FreeTDS 0.63. .\" .Sh AUTHORS The .Nm utility was written by .An James K. Lowden Aq jklowden@schemamania.org. .\" .Sh BUGS Works only with Microsoft servers and ancient Sybase servers. Does not create primary keys. Many options are defined by Sybase that this version does not implement. Feel free to correct this situation. In theory, .Nm could apply/produce DDL for any system object, but at present only tables, procedures and views are supported, and only for extraction. man1/osql.1000064400000003737147633110370006457 0ustar00.\" cf. groff_mdoc .Dd April 26, 2012 .Os FreeTDS 1.4.9 .Dt OSQL FreeTDS "FreeTDS Reference Manual" .\" .Sh NAME .Nm osql .Nd utility to test FreeTDS connections and queries .\" .Sh SYNOPSIS .Pp .Nm .Fl S Ar dsn .Fl U Ar username .Fl P Ar password .Op Fl I Pa ini_directory .\" .Sh DESCRIPTION .Pp .Nm is a diagnostic tool provided as part of FreeTDS. It is a Bourne shell script that checks and reports on your configuration files. If everything checks out OK, it invokes isql. .Pp .Nm works only with the isql that comes with unixODBC. .\" .Sh OPTIONS .Bl -tag -width indent .It Fl S Ar dsn the Data Source Name to which to connect, as known to .Pa odbc.ini Ns . .It Fl U Ar username database login name. .It Fl P Ar password database password. .It Fl I Ar ini_dir override .Pa odbc.ini file location. .El .\" .Sh EXAMPLE If you have an .Pa odbc.ini with a section like this: .Bd -literal -offset indent .Bq myDSN servername = myserver TDS_Version = 5.0 .Ed .Pp You would invoke .Nm as: .Pp .Li osql -S myDSN .Op .\|.\|.\& .\" .Sh FILES .Pa odbc.ini .Pa freetds.conf .\" .Sh NOTES If you can connect with .Ql osql -S servername -U user -P passwd Ns , your FreeTDS ODBC installation is working. .Pp .Nm guesses where unixODBC might look for its .Pa odbc.ini by examining the binary. This is not always an effective approach. If it doesn't work, you'll receive a report of candidate strings. Kindly pass along the output to help improve the guessing. .Pp If .Nm cannot intuit your .Pa odbc.ini directory, you can force the issue with the .Fl I option. However, you're then instructing .Nm what to test, not where unixODBC will eventually look. Your override is therefore only as good as you are. Look carefully at the error output before overriding. .Pp If you have suggestions for ways to make .Nm more useful as a diagnostic tool, please post them to the FreeTDS mailing list. .\" .Sh HISTORY .Nm first appeared in FreeTDS 0.65. .\" .Sh AUTHORS The .Nm utility was written by .An James K. Lowden Ns . man1/freebcp.1000064400000014317147633110370007103 0ustar00.\" cf. groff_mdoc .Dd March 25, 2015 .Os FreeTDS 1.4.9 .Dt FREEBCP 1 .Sh NAME .Nm freebcp .Nd bulk loading utility for Sybase and Microsoft databases .Sh SYNOPSIS .Nm .Bo Bo Ao Ar database Ac Ns . Bc Ns Ao Ar owner Ac Ns . Bc Ns Aq Ar object_name .Bro .Ar in | .Ar [query] Ns Ar out .Brc .Ar datafile .Bro .Fl c | .Fl n | .Fl f Ar formatfile .Brc .Op Fl S Ar servername .Op Fl D Ar dbname .Op Fl U Ar username .Op Fl P Ar password .Op Fl b Ar batchsize .Op Fl F Ar firstrow .Op Fl L Ar lastrow .Op Fl e Ar errfile .Op Fl I Ar interfaces .Op Fl m Ar maxerror .Op Fl t Ar field_term .Op Fl r Ar row_term .Op Fl h Ar hints .Op Fl T Ar textsize .Op Fl A Ar packet_size .Op Fl O Ar options .Op Fl i Ar inputfile .Op Fl o Ar outputfile .Op Fl C Ar charset .Op Fl EdVv .\" .Sh DESCRIPTION .Nm is a utility program distributed with FreeTDS. .Nm replicates (in part at least) the functionality of the bcp utility programs distributed by Sybase and Microsoft. .Nm makes use of the DB-Library bcp API provided by FreeTDS. This API is also available to application developers. .Pp The manual pages or online help for Sybase or SQL Server can be referenced for more detailed information on bcp functionality. .\" .Sh TABLES\ AND\ FILES .Bl -tag -width indent .It Ar database The name of the database containing object to be copied. Optional if the table/view is in the default database for .Ar username . .It Ar schema The schema of the object being copied. If not provided, the default schema for .Ar username is used. .It Ar object The name of the database object you wish to access, typically a table. It can also be a view. All views can be read; some can be written, subject to constraints. With .Ar queryout Ns , Ar object can also be an SQL query. .It Ar in Copy data from a host file to a database table. .It Ar out Copy data from a database table to a host file. .It Ar queryout indicates that .Ar table_name is in fact SQL, rather than a database object. .Nm will execute the query and write the results to a file. (It is a good idea to have the query return one and only one result set.) .It Ar datafile The name of an operating system file. .El .\" .Sh OPTIONS .Bl -tag -width indent .It Fl A Ar packet_size Set the size of a TDS packet to packet_size. Not sure why you would want to do this, except as an experiment. .It Fl D Ar dbname The name of the default database to use. Overrides default database associated with the login account. Causes .Nm to issue a .Ic USE Ar dbname command immediately after logging in, before commencing BCP operations. .It Fl E Write the data in datafile to the table's IDENTITY column. Without this flag, the identity data present in the datafile will be ignored, and new IDENTITY values will be generated for the imported rows. .It Fl F Ar firstrow The first row to copy from the input file or database table. The default is the first row, row 1. .It Fl I Ar interfaces The name and location of the .Pa interfaces file to search when connecting to servername. Overrides .Pa freetds.conf. .It Fl L Ar lastrow The last row to copy from an input file or database table. The default is the last row. .It Fl O Ar options SQL text to set connection options prior to the bcp operation. If .Ar options is a valid filename, the SQL is read from the file instead. Sometimes needed for .Ar queryout . Example: .Li -O `SET QUOTED_IDENTIFIER ON' Ns . .It Fl P Ar password The password associated with .Ar username . .It Fl S Ar servername The name of the Database Server to which to connect. .It Fl T Ar textsize For text or image columns, set the maximum number of characters to request from the server. Defaults to the setting in .Pa freetds.conf . If not specified anywhere, defaults to the full size of the data. .It Fl U Ar username A database login name. For TDS\ 7+ connections, a domain login is attempted if .Ar username is not provided. .It Fl b Ar batchsize The number of rows per batch of data copied. Batching applies only when you are bulk copying into the database. Each batch of data is effectively .Dq committed into the database. The default value for .Ar batchsize is 1000. .It Fl c The host data file is (or will be) in "character" format, i.e., a text file. Encoding is determined by the client charset attribute in .Pa freetds.conf . .It Fl d Turn off any logging. (Unintuitive, perhaps.) .It Fl e Ar errfile Write errors to .Ar errfile . For uploads. Includes line and column information, and the row data. .It Fl f Ar formatfile The format of the host data file is described by .Ar formatfile . The layout of .Ar formatfile is identical to that understood by the Sybase and Microsoft bcp utilities, but is too complicated to describe here. .It Fl h Ar hints Set bcp hints. For valid values, cf. .Fn bcp_options in the FreeTDS Reference Manual. .It Fl m Ar maxerror Stop after encountering .Ar maxerror errors. Default 10. .It Fl n The host data file is in .Dq native format. This is a format that .Nm will be able to process, but is not portable or readable. .It Fl r Ar row_term The row terminator for a character file. May be more than one character. Default is newline ('\\n'). Cf\&. .Fl c Ns , above. .It Fl t Ar field_term The field terminator for character file. Also known as a column delimiter. May be more than one character. Default is tab ('\\t'). Cf\&. .Fl c Ns , above. .It Fl v .It Fl V Print the version information and exit. .It Fl i Ar inputfile Read input data from file specified. .It Fl o Ar outputfile Write output data to file specified. .It Fl C Ar charset Specify character set to use to talk to server. .El .Sh ENVIRONMENT .Ev DSQUERY default .Ar servername .\" .Sh NOTES When connecting to a Sybase database server, it is required that the TDS 5.0 protocol be used. When connecting to a Microsoft SQL Server 2000 database server, the TDS\ 7 (or later) protocol is required. .Pp Sybase and Microsoft define different versions of the bcp portion of TDS 4.2. Because FreeTDS has no way of knowing which type of server it's connected to, .Nm does not support version 4.2 of the TDS protocol. .\" .Sh HISTORY .Nm first appeared in FreeTDS 0.60 .Sh AUTHORS The .Nm utility was written by .An Bill Thompson Aq thompbil@exchange.uk.ml.com .Sh BUGS Currently, there is no support for text data types in .Nm Ns , when SQL Server 2000 is the target server.