Background documentationOverview of All SQLCLI Call Options Locate this document in the navigation structure

 

You can call the SQLCLI program with options:

sqlcli [<options>]

Call Options: Database Session

Option

Description

-d <database_name>

Database name

-e

Encrypted data transmission

-n <database_computer>[:<port>]

Name of the computer on which the database is installed

If you are not using the standard port of the SAP MaxDB X Server, enter your port here. See X Server, Ports and Protocols of the X Server

-r

Enforces execution of SQL statements as statements rather than as prepared statements

-S <sql_mode>

SQL mode

-u <database_user,database_user_password>

User name and password for logging on to the database

-U <user_key>

Log on using user key

-y <timeout>

Timeout value (in seconds) for the database session

If you do not specify this option, SQLCLI uses the default value for the database.

-z

Switches AUTOCOMMIT mode off

Call Options: Input and Output

Option

Description

-c <separator>

When importing commands from a file, SQLCLI uses the <separator> to separate the individual commands.

The default value is //.

-i <file>

Imports commands from the batch file <file>

-j

Displays results consecutively (not page by page)

-m

Activates multiple line mode for entering SQLCLI commands

-o <file>

Writes the results to the <file>

-x

Suppresses additional output such as the number of selected rows in a result set

Call Options: Formatting the Output

Option

Description

-A

Returns the result set unformatted (without being filled with spaces)

SQLCLI separates columns with commas and rows with line breaks. This output format is particularly suitable for generating comma-separated files (.csf).

-a

Suppresses the output of the column names in the result set

-b <maximum_length>

Defines the maximum number of characters for output of LOB values.

Default value: 10 characters

-f

SQLCLI returns all SQL statements before sending them to the database instance.

-F <separator>

Specifies which string SQLCLI uses as a separator between the individual columns of the result set

Default value: |

-g <null_value>

Specifies the character for null values in the result set

Default value: ?

-p <prefix>

Specifies which string is to be output before each row of the result set

Default value: |

-P <suffix>

Specifies which string is to be output after each row of the result set

Default value: |

-Q

Outputs each column of the result set in a new row

Call Options: Other

Option

Description

-E <exit_code>

If an error occurs, SQLCLI terminates automatically and returns the error message <exit_code> .

-h

Displays the help

-t

Outputs debug information

-T <file>

Activates the SQLDBC trace

SQLDBC writes the trace data to the <file>

-v

Displays version information about the SQLCLI program