.TH STILTS-SQLCLIENT 1 "Mar 2017" "" "Stilts commands" .SH NAME stilts-sqlclient \- Executes SQL statements .SH SYNOPSIS .ad l .HP 17 .hy 0 \fBstilts sqlclient\fR [db=\fI\fR] [user=\fI\fR] [password=\fI\fR] [sql=\fI\fR] [ofmt=\fI\fR] .hy .ad .SH DESCRIPTION .PP \fIsqlclient\fR is a simple command-line client for use with SQL databases. One or more SQL statements can be supplied using the \fIsql\fR parameter. The result of each statement may be one or more update counts (for update-type statements) or tables (for query-type statements). Tables will be written to standard output in a format given by the \fIofmt\fR parameter. Update results and timing information will be written to standard error. .PP In most cases, you will find life easier if you use either the database's own command-line or GUI client, or, if you require STILTS-type format conversion or post-processing, a \fIjdbc:\fR-format URL for the \fIin\fR parameter of the \fItpipe\fR or \fItcopy\fR commands (see SUN/256 for more explanation of the latter). However, this command enables you to submit multiple queries over the same JDBC connection, including ones which do not generate a tabular result. It may be useful if a command-line client is not available to you for the database you are using. .PP This command can only be used if you have access to an SQL database via JDBC. The details of how to configure a JDBC connection to a database are discussed in SUN/256 - obviously you will need a database to connect to and appropriate permissions on it as well as the relevant drivers. .PP \fBThis command is experimental\fR, and it may be enhanced, renamed or withdrawn in future releases. .SH OPTIONS .TP \fBdb=\fI\fR .RS URL which defines a connection to a database. This has the form \fIjdbc::\fR - the details are database- and driver-dependent. Consult Sun's JDBC documentation and that for the particular JDBC driver you are using for details. Note that the relevant driver class will need to be on your classpath and referenced in the \fIjdbc.drivers\fR system property as well for the connection to be made. .RE .TP \fBuser=\fI\fR .RS User name for logging in to SQL database. Defaults to the current username. .RE .TP \fBpassword=\fI\fR .RS Password for logging in to SQL database. .RE .TP \fBsql=\fI\fR .RS Text of an SQL statement for execution. This parameter may be repeated, or statements may be separated by semicolon ("\fI;\fR") characters. .RE .TP \fBofmt=\fI\fR .RS Specifies the format in which the output table will be written (one of the ones in SUN/256 - matching is case-insensitive and you can use just the first few letters). If it has the special value "\fI(auto)\fR" (the default), then the output filename will be examined to try to guess what sort of file is required usually by looking at the extension. If it's not obvious from the filename what output format is intended, an error will result. .RE .SH SEE ALSO \fBstilts\fR(1) .PP If the package stilts-doc is installed, the full documentation \fBSUN/256\fR is available in HTML format: .br \%file:///usr/share/doc/stilts/sun256/index.html .SH VERSION STILTS version 3.4.10-debian .PP This is the Debian version of Stilts, which lack the support of some file formats and network protocols. For differences see .br \%file:///usr/share/doc/stilts/README.Debian .SH AUTHOR Mark Taylor (Bristol University)