Entering content frame

Procedure documentation Call with the Loader CLI (LOADERCLI) Locate the document in its SAP Library structure

You can call the Loader using the Loader CLI Client (LOADERCLI).

Call

loadercli [<options>]

You can specify options when you call the Loader. Note the following options in particular:

·        You can use the option -r to decide whether you want to use the Loader Server embedded in the Loader CLI or the Loader Server that is separate from the Loader CLI.

·        You can use the option -b to specify the operating mode. This determines whether the commands and SQL statements are processed interactively or in the background.

Process Flow

Before it connects to the database instance, the Loader CLI first evaluates the relevant options. The commands and SQL statements in the command file (or those entered interactively) are then executed.

Example

Calling the separate Loader (server and client in one program), which then processes the commands and SQL statements in the background

loadercli -d hoteldb -u mona,red –b command.dat -E 20

The Loader processes the commands and SQL statements contained in the command.dat command file. The Loader processes the commands and SQL statements contained in the command.dat command file. If errors occur (return code <> 0), processing of the command file is terminated as soon as 20 error messages occur.

Example

Calling the Loader Server separately from the Loader CLI on the local host. The Loader Server then processes the commands and SQL statements in the background.

loadercli –d hoteldb -u mona,red –r genua –b command.dat -E 20

The Loader CLI creates a connection to the Loader Server on the local host genua. The Loader Server creates a connection to the database instance hoteldb for the user mona. The Loader processes the commands and SQL statements contained in the command.dat command file. If errors occur (return code <> 0), processing of the command file is terminated as soon as 20 error messages occur.

Example

Calling the separate Loader (server and client in one program), which then processes the commands and SQL statements interactively

loadercli –d hoteldb -u mona,red

The Loader creates a connection to the database instance hoteldb for the user mona. The Loader then waits for the commands and SQL statements in the command line, and processes them.

Result

The Loader executes the commands and SQL statements. The Loader writes a log file.

Errors

If errors occur when commands or SQL statements are processed, the way in which the Loader responds depends on whether it is running interactively or in the background.

If you are using the Loader in interactive mode, it registers the error, and then waits for your next entry.

If you are using the Loader in the background, it stops processing commands and SQL statements after a defined number of errors, and exits. You can use the option –E to define the number of errors that the Loader ignores before it stops processing commands. If you do not use the option –E, the Loader stops running after the first command with an error. You cannot react to the errors when you are using the Loader CLI.

Note

If you want to respond to errors, the Loader functions are available as a library for the Perl and Python script languages.

See also:

Perl Manual, SAP::DBTech::loader Module

Python Manual, sapdb.loader Module

 

Leaving content frame