## Session Mode

In session mode the user can transfer the Loader commands and SQL statements to the Loader directly via the console.

### Use

You can start Loader CLI in session mode. To do so, enter the following command:

loadercli

If, for example, you want to transfer the connection information at the same time as the Loader CLI is called, use the corresponding options.

loadercli
[<connect_options>]
[<in_output_options]
[<version_options>]

Features

Enter the requested options for establishing the connection, for input and output control and for version queries.

connect_options

-d <database_name> | Name of database instance
-u <database_user>[,<password>] | Name and password of the database user
-n <database_computer>[:<port>] | Name of the database computer Default value: local computer
-s <schema_name> | Name of the database schema Default value: schema of the current database user
-e <encryption> | Encryption method Possible values: SSL (currently, only SSL/TLS encryption is supported in SAP systems)

See also: Options for Establishing a Connection

in_output_options

-o[w|a] <file_name> | Name of the output file
-cs <command_separator> | Specifies a command separator Default value: ENTER
-ps <number><string> | Specifies a substitution parameter
-E <number> | Maximum permitted number of errors

See also: Options for Input and Output

version_options

-V | Version of the Loader server
-v | Version of the Loader CLI
-R <dependent_path> | Directory that contains the programs that depend on the version of the database software

See also: Options for Determining Version Information

Examples

loadercli -d demodb -u mona,red -s hotel

The Loader establishes a connection to the database instance DEMOB for the user MONA in the scheme HOTEL. The Loader then waits for the commands and SQL statements in the command line. These must each be completed with an ENTER for Loader to process them.

loadercli -d demodb -u mona,red -cs ;

The Loader establishes a connection to the database instance DEMOB for the user MONA. The Loader waits for the commands and SQL statements in the command line. These must each be completed with a semicolon for Loader to process them.

For more examples, see the Loader-Tutorial, Session Mode.

Explanation

After starting the Loader CLI in session mode, you can interactively enter several commands and SQL statements.

#### Command Separator

The default value for a command separator is ENTER. If you enter a Loader command that runs over more than one line and you end one of these lines with a forward slash (‘/’), the Loader CLI recognizes that the command is not yet complete. It is therefore not yet executed when the command separator ENTER is inserted. Only when you enter the command separator ENTER without preceding it with a forward slash does the Loader CLI recognize that the command is complete.

You can change this behavior by defining another command separator using the option –cs <command_separator> . If, for example, you choose the semicolon as the command separator, you can write every command without special termination over several lines. Only when you enter the command separator semicolon does the Loader CLI recognize that the command is complete.

Once the command separator is received, the command is sent to the Loader Server, which executes it. After all the commands and SQL statements have been executed, the Loader CLI displays a message.

To end the session mode, enter release or exit, followed by the command separator.

See also:

Call Options of the Loader CLI

Log File