[Net 2000 Ltd. Home][DataBee Home][DataBee Manual][DataBee FAQ]

Set Loader Command Line Arguments

The Set Loader application can be run in batch mode from a DOS command line or Windows based scheduler in order to automate the loading of data from a source into a target schema.

Automated load and exit is controlled by providing the appropriate command line options when the application starts. The options required to automate the load process are:

<Loader Set Filename>
The name of the loader set to open. This must be a full path including the drive and directory information. The Set Loader application will not use default directories in command line mode. If the loader set filename contains spaces, remember to enclose it in double quotes when placing it on the command line otherwise the Windows operating system will present it to the Set Loader application as multiple command line options.

-R
The signal to Run the loader set and perform the load operations.

-X
The signal to eXit after the loader set has completed. In order to determine if the loader set completed successfully or failed with an error it is necessary to examine the application exit code (see the discussion below).

-S <param>
The login Substitution parameter. The loader set can be configured with dummy login information in the Rule Controllers and have that information substituted by the command line. This functionality enables the target schema of a loader set to be determined at runtime. The format of the login substitution parameter is always

<DummySchema>@<DummyTNSName>=<RealSchema>/<RealPassword>@<RealTNSName>

The Login Substitution Parameter section below contains more information and examples.

If the Loader Set filename is specified and the -R option is omitted then the Set Loader application will simply open the Loader Set and return to manual operating mode.

Exit Codes

When run from a command line, the Set Loader application will return an exit code via the standard DOS mechanism. If the last run of the loader rules was a success then this exit code will always be zero. Any non-zero exit code implies that an error occurred while opening the loader set or while running the loader rules. If a non-zero exit code is returned, the log file should always be examined to determine the error that occurred. Some of the more common exit codes are:

101
The loader set was not found. See the log file for more information.
201
The loader set run was cancelled by user request.
301
Errors occurred during the run of the loader set. See the log file for more information.
1000-1999
Errors occurred during the pre-run checks of the loader set. See the log file for more information.

The exit code value is returned using the Windows standard mechanisms and can be determined via any of the available Windows methods. The most common way to view the return code is by using the DOS echo %errorlevel% command. The script output below shows such an operation. The 301 exit code means the loader set execution failed with an error.

C:\Program Files\DataBee for Oracle>start /wait SetLoader.exe C:\Net2000\DTB_TestSets\DataBee_Sample_Schema.LoadSet -R -X
C:\Program Files\DataBee for Oracle>echo %errorlevel%
301
C:\Program Files\DataBee for Oracle>
Important Note: The Start /Wait Command

There is an important consideration which must be noted when launching Windows applications from a command line. The Command application will, by default, launch a Windows application as a separate process. Once started, the Command application will not monitor the running Windows application process. In effect, this behaviour means that immediately after launching the Windows application, the Command application will return to the DOS prompt and continue with the next command statement. It is not possible to retrieve the exit code in such circumstances and the next operation in the Command application will begin to process long before the loader set has completed.

If it is necessary for the Command line application to wait until the loader set has executed (and the Set Loader application has shutdown) before it executes the next operation, then the Set Loader application must be launched with the DOS start /wait command. The example below illustrates these concepts:

C:\Program Files\DataBee for Oracle>REM the errorlevel will be set and the next command will only
C:\Program Files\DataBee for Oracle>REM    be performed once the loader set is complete
C:\Program Files\DataBee for Oracle>start /wait SetLoader.exe C:\Net2000\DTB_TestSets\DataBee_Sample_Schema.LoadSet -R -X
C:\Program Files\DataBee for Oracle>echo %errorlevel%
C:\Program Files\DataBee for Oracle> ... perform next command

C:\Program Files\DataBee for Oracle>REM the errorlevel will always be zero and the next command will be C:\Program Files\DataBee for Oracle>REM performed immediately without waiting for the Set Loader application C:\Program Files\DataBee for Oracle>REM to complete C:\Program Files\DataBee for Oracle>SetLoader.exe C:\Net2000\DTB_TestSets\DataBee_Sample_Schema.LoadSet -R -X C:\Program Files\DataBee for Oracle>echo %errorlevel% C:\Program Files\DataBee for Oracle> ... perform next command

The Login Substitution Parameter

The Login Substitution Parameter always follows the -S command line option and is used to replace dummy values configured in the Rule Controller with values specified on the command line. The format of the login substitution parameter is always

<DummySchema>@<DummyTNSName>=<RealSchema>/<RealPassword>@<RealTNSName>

For example, a Rule Controller might be configured with a schema of FOO and a TNSName of BAR. In that case, a command line with the option -S FOO@BAR=scott/tiger@testdb1 would check each Rule Controller in the loader set and substitute the real connection information of scott/tiger@testdb1 in place of FOO@BAR. The dummy values of FOO@BAR serve as place holders for the real information and allow the appropriate Rule Controller to be updated at run time. An loader set can have multiple Rule Controllers. In that circumstance, multiple substitution parameters can be configured as shown below:

-S FOO@BAR=scott/tiger@testdb1 -S ABC@TESTDB=dmtest/dmtestpass@Test10G

Examples

Load a Loader Set file only
start /wait SetLoader.exe "C:\Program Files\DataBee for Oracle\Loader Sets\scott.LoadSet"
Load, Run and Exit
start /wait SetLoader.exe "C:\Program Files\DataBee for Oracle\Loader Sets\scott.LoadSet" -R -X
Load, Run and Exit and Substitute login details
start /wait SetLoader.exe "C:\Program Files\DataBee for Oracle\Loader Sets\scott.LoadSet" -R -X -S FOO@BAR=scott/tiger@testdb1


[Net 2000 Ltd. Home][DataBee Home][DataBee Manual][DataBee FAQ]