Entering content frame

Procedure documentation Executing Commands Locate the document in the library structure

Use

You execute an SQL statement, database procedure or special SQLCLI command in the SQLCLI (see Overview of the SQLCLI Commands).

Prerequisites

Some commands require you to be logged on to the database instance.

Executing an Individual Command in Interactive Mode (Session Mode)

...

       1.      Start the SQLCLI program. To do so, you can use the Call Options.

sqlcli [<options>]

       2.      Enter the command.

<command>

Note

You can also enter commands in multiple row mode or edit commands in an external file.

Example

Start the SQLCLI program and log on to the database instance DEMODB as user MONA with the password RED:

sqlcli -d DEMODB -u MONA,RED

Display general information about the database instance:

\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

You can find further information in the following sections:

Executing SQL Statements

Executing Database Procedures

Requesting Information about the Database Catalog

Executing Shell Commands

Executing an Individual Command in Command Mode

...

       1.      Call the SQLCLI and enter the command directly.

sqlcli [<options>] <command>

Example

sqlcli -d DEMODB -u MONA,RED \s

Caution

If you want to enter an SQL statement or a database procedure as a command, put the SQL statement/database procedure in quotation marks.

Example

sqlcli –d DEMODB –u MONA,RED ″select CNO,TITLE,FIRSTNAME,NAME,ZIP from HOTEL.CUSTOMER″

The SQLCLI executes the command and then ends itself.

Executing Several Commands from a Batch File

If you are in interactive mode, enter the path and name of the batch file<file> from which the SQLCLI is to export the command as follows:

\i <file>

     If you are working in command mode, enter the path and name of the batch file <file> as follows when you log on to the database instance:

sqlcli [<options>] -i <file>

See also:

Redirecting a Result to a File

 

 

Leaving content frame