You can use SQLCLI to execute SQL statements, database procedures, and special SQLCLI commands.
Some commands require you to be logged on to the database.
More information: Logging On to a Database
Call SQLCLI:
sqlcli [<options>]
More information: Overview of All SQLCLI Call Options
Enter the command.
<command>
Note
You can also enter commands in multiple line mode or edit commands in an external file.
More information:
Example
You start SQLCLI and log on to the DEMODB database as user MONA with the password RED:
sqlcli -d DEMODB -u MONA,RED
You display general information about the database:
\s
host: localhost
database : demodb
xuserkey :
user: MONA
kernel version: KERNEL 7.6.00 BUILD 009-103-092-269
sapdbc version: libSQLDBC 7.6.0 BUILD 009-103-092-248
unicode : NO
default code : ASCII
sql mode : INTERNAL
autocommit : ON
More information:
Call SQLCLI and enter the command directly.
sqlcli [<options>] <command>
Example
sqlcli -d DEMODB -u MONA,RED \s
If you want to enter an SQL statement or a database procedure as a command, place the SQL statement or database procedure in quotation marks.
Example
sqlcli -d DEMODB -u MONA,RED "select CNO,TITLE,FIRSTNAME,NAME,ZIP from HOTEL.CUSTOMER"
SQLCLI executes the command and then exits.
If you are in interactive mode, enter the path and name of the batch <file> from which SQLCLI is to import the command as follows:
\i <file>
More information: Batch File
If you are working in command mode, enter the path and name of the batch <file> when you log on to the database as follows:
sqlcli [<options>] -i <file>