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:
<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
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>
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 commandC:\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
<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