man dbtcp (Commandes) - command line client for dbtpc ODBC proxy server

NAME

dbtcp - command line client for dbtpc ODBC proxy server

SYNOPSIS

dbtcp [OPTION] [REMOTE_DSN] [HOST] [PORT]

DESCRIPTION

dbtcp is a command line client used to query an ODBC data source (DSN) on a Windows machine via the dbtcp ODBC proxy server.

-e, --escape-chars
Escape control characters when writing strings
-2, --2dsn
Second DSN to connect to
-p, --port
TCP port number to connect to dbtcp server on
-h, --help
Display usage information

dbtcp is a simple command line client that can be used to run queries remotely against an ODBC data source (DSN) on a Windows machine by connecting to a dbtcp server running on the Windows machine.

dbtcp accepts SQL queries on standard in, and prints results to standard out. Queries can be entered entered one at a time (interactively), or can be piped to dbtcp. The GNU Readline library is used, allowing for editing and history on the prompt. Interactive mode can be terminated with an EOF character (CTRL-D).

In addition to the dbtcp client, there are also interfaces to connect to the dbtcp server and retreive data programmatically using Perl, C, or PHP.

When running dbtcp, one usually sets the REMOTE_DSN, HOST and PORT arguments.

REMOTE_DSN is a connection string used to specify the data source to connect to on the windows machine. It is usally in the form "DSN=mydsn", where mydsn is the name of the DSN on the Windows machine. Alternatively, it is possible to specify a username and password to pass to the DSN with a string such as "DSN=mydsn;UID=myusr;PWD=mypass". This connect string is not interpreted by dbtcp, and is passed straight to the ODBC driver. Some ODBC drivers may accept other parameters.

HOST is the host that the dbtcp server is running on.

PORT is the TCP port to connect to the host on. If the port is not specified, it will default to 3000.

The supplied REMOTE_DSN, HOST and PORT arguments are cached by dbtcp. If they are not supplied when running dbtcp, then dbtcp will default to the previously specified values.

EXAMPLES

dbtcp DSN=mydsn winhost

Interactively query the "mydsn" DSN on "winhost".

dbtcp DSN=mydsn;UID=myuser;PWD=mypass winhost 4321

Connect to "winhost" on port 4321 and interactively query the "mydsn" DSN, passing the "myuser" and "mypass" usename and password parameters to the ODBC driver.

echo "SELECT * FROM foo" | dbtcp DSN=mydsn > foo.txt

Dump data from the foo table into foo.txt.

FILES

~/.dbtcprc This file is used by dbtcp to cache the arguments that it is run with, to allow it to default the same parameters for subsequent connections.
~/.dbtcp_history This is the history file to allow SQL queries used in previous dbtcp sessions to be recalled (using the up and down cursons) in later sessions.