# PxPlus SQL Command Line Client

> Source: https://manual.pvxplus.com/odbc/pxplus-sql-cmd-line-client

The PxPlus SQL Command Line Client connects to local or remote PxPlus data and executes SQL commands. This tool is built on top of the PxPlus SQL ODBC Driver; therefore, it supports the same [SQL Syntax](https://manual.pvxplus.com/odbc/using-odbc-driver/sql-syntax-table) and [Scalar Functions](https://manual.pvxplus.com/odbc/using-odbc-driver/scalar-functions) as the PxPlus SQL ODBC Driver. It is based off the PxPlus SQL ODBC Driver and therefore can connect using a DSN defined for the PxPlus SQL ODBC Driver (see [Configuration Procedures](https://manual.pvxplus.com/odbc/configuration-procedures)), or it can connect using a connection string used by the PxPlus SQL ODBC Driver (see [Connection String Keywords](https://manual.pvxplus.com/odbc/configuration-procedures/connection-string-keywords)).

By providing a command line client that can access PxPlus data, users now have a fast and simple way to query, update and write PxPlus data. This also makes it a great tool to test PxPlus data, the PxPlus SQL ODBC Driver, and connection settings. In addition, the SQL Command Line Client can be executed from Web pages, scripts and applications, providing new ways to use your PxPlus data.

A Windows version and a UNIX/Linux version of the PxPlus SQL Command Line Client are available. The SQL Client gets installed with the PxPlus SQL ODBC Driver (version 10 or higher).

For installation procedures, see:

**[ODBC Product Installation and Activation (Windows)](https://manual.pvxplus.com/odbc/installation-procedures/odbc-product-installation-activation)**  
**[ODBC Product Installation and Activation (UNIX/Linux)](https://manual.pvxplus.com/odbc/installation-procedures/odbc-product-installation-activation-unix)**

## Running the SQL Command Line Client

To run the SQL Command Line Client, simply run the *pxpsql* program:

*dir* / *pxpsql* **\[Connection Info\]** **\[Options\] COMMAND**

***Where:***

*dir* is the directory path (e.g. /usr/pxpodbc).

## Connection Info

One of the following Connection Info parameters must be specified:

|  |  |
| --- | --- |
| **-d** *path*  <br>**--directory** *path* | Path of the data dictionary file (DDF), which is the relative starting point for all embedded file references. See **[PxPlus Data Dictionary](https://manual.pvxplus.com/odbc/table-definitions/pxplus-data-dictionary)**.<br>This should only be set if ***not connecting*** to PxPlus SQL Server; i.e. **-s** *address* is ***not set*** (see **[Options](https://manual.pvxplus.com/odbc/pxplus-sql-cmd-line-client#options)**).<br>The path should ***not include*** the data dictionary file name.<br>***Example:***<br>If the DDF is located at *C:\\myapp\\data\\providex.ddf*, then set **-d** *C:\\myapp\\data*. |
| **-i** *path*  <br>**--ini-file** *path* | Path and file name of the INI file used to define the data dictionary manually for files that cannot be handled by the PxPlus embedded data dictionary. See **[INI Definition](https://manual.pvxplus.com/odbc/table-definitions/ini-definition)**.<br>This should only be set if ***not connecting*** to PxPlus SQL Server; i.e. **-s** *address* is ***not set*** (see **[Options](https://manual.pvxplus.com/odbc/pxplus-sql-cmd-line-client#options)**).<br>The path ***must include*** the INI file name.<br>***Example:***<br>If the INI is located at *C:\\myapp\\data\\mydict.ini*, then set **-i** *C:/myapp/data/mydict.ini*. |
| **--catalog** *name* | Name of catalog. A catalog defines a remote data dictionary and/or INI file and optionally a prefix.<br>This ***must*** be set if ***connecting*** to PxPlus SQL Server; i.e. **-s** *address **is set*** (see **[Options](https://manual.pvxplus.com/odbc/pxplus-sql-cmd-line-client#options)**).<br>*(added in PxPlus 2018)* |
| **-f** *path*  <br>**--config-file** *path* | Path and file name of the *config* file.<br>Note:  <br>If other options are specified, they override configuration in the config file. The config file is an INI style file, which accepts parameters that are the same as the long form pxpsql parameters.<br>***Example:***<br>This is an example *config* file:<br>![](https://manual.pvxplus.com/migration-assets/213354116c06de69654ec8ae23673ee2b2d37f2ced34234376c3af12ea9777e0.png) |
| **-c** *conn_str*  <br>**--connection-string** *conn_str* | Specify the connection string directly. This ignores other Connection Info parameters. See **[Connection String Keywords](https://manual.pvxplus.com/odbc/configuration-procedures/connection-string-keywords)**. |

## Options

This table lists optional Connection Info parameters:

|  |  |
| --- | --- |
| **-v** *path*  <br>**--view-dll** *path* | Path and file name of the PxPlus DLL/SO file. This is required to use the **[Views System](https://manual.pvxplus.com/views-system/introduction)**. |
| **-x** *path*  <br>**--prefix** *path* | Search paths to be inserted in front of all relative file references. Use , *(comma)* to separate multiple prefixes. |
| **-s** *address*  <br>**--server** *address* | Network name or IP address required for connecting to the PxPlus SQL Server. See **[PxPlus SQL Server](https://manual.pvxplus.com/odbc/pxplus-file-server)**. |
| **-p** *port*  <br>**--port** *port* | TCP/IP Port required for connecting to the PxPlus SQL Server. See **[PxPlus SQL Server](https://manual.pvxplus.com/odbc/pxplus-file-server)**. |
| **--ssl** | Enable SSL encrypted TCP/IP communication.<br>*(SSL support was added in version 8.00.0000/PxPlus 2024.)* |
| **-z**   <br>**--compression** | Enable ZLib compression to minimize network traffic between the client and the server. |
| **-j** *name*  <br>**--company** *name* | Value to replace occurrences of %%C$ in a definition pathname. |
| **-u** *name*  <br>**--user** *name* | Value to replace occurrences of %%U$ in a definition pathname. |
| **-w** *password*  <br>**--password** *password* | Password value. Used in conjunction with a Sage MAS 90 or Sage MAS 200 system ***only***. |
| **-o** *ID*  <br>**--session-id** *ID* | Value to replace occurrences of %%S$ in a definition pathname. |
| **-r**   <br>**--dirty-read** | Enable dirty read mode, which causes normal file consistency checks to be skipped. |
| **-e**   <br>**--enforce-double** | Enable treating numeric data as doubles. |
| **-b**   <br>**--burst-mode** | Enable burst mode, which reduces the number of times a file is locked by holding the lock for either 50 operations or 3/10 of a second, whichever comes first. |
| **-n**   <br>**--null-date** | Enable suppression of invalid date error. |
| **-k**   <br>**--key-restrict** | Enable key restrict mode. This option allows the Driver to be used with applications that do not support keys or supports keys with limitations. |
| **-t**   <br>**--strip-trailing-spaces** | Enable strip trailing spaces from key values when joining multiple tables. |
| **-q**   <br>**--silent** | Enable suppression of most messages. |
| **-a** *size*  <br>**--cache-size** *size* | Amount of memory in MB used for local storage of intermediate results. |
| **-l** *path*  <br>**--log-file** *path* | Output debugging information to a specified log file. |
| **-y**   <br>**--read-only** | Disable write access for this SQL command. |
| **--legacy-null** | Enable legacy NULL mode where empty strings are treated as nulls.<br>*(Added in PxPlus 2017)* |
| **-g** *separator*  <br>**--separator** *separator* | Set separator string used to update query results. ***Default*** value is "**\|**". |
| **-m**   <br>**--html** | HTML output mode. In this mode, query results are outputted as HTML table data. |
| **--column-names** | Include a header row with column names in the output.<br>*(Added in PxPlus 2016)* |
| **--version** | Output the version number.<br>*(Added in PxPlus 2016)* |

## Command

One of the following must be specified:

|  |  |
| --- | --- |
| **SQL Command** | SQL query (e.g. "SELECT \* FROM CUSTOMER" used to read or modify data). |
| **LIST** | Command used to display list of table names. |
| **LIST** *table* | Command used to display list of column names, column types and column lengths for given table.<br>*(Added in PxPlus 2016)* |
