|
Schema
> Products
> SRTransport
> Doc
> SRTransportES
> Operation
Operation of SRTransportES
'srtransport_es'
SRTransportES reads all of its parameters from a .transport file. Certain parameters can be overridden on the command line.
The interactive application, SRTransport, creates a .transport file that contains a complete set of instructions for transporting data from a source into a destination. Once the .transport file is created interactively, it can be read by a batch mode version of SRTransport called srtransport. Use srtransport to upload data without human supervision. srtransport allows you to override some of the settings in a .transport file.
On OSX/OSX Server and Windows NT/2000, SRTransportES is part of SRtransport. The executable srtransport is inside the SRTransport.app directory. On Solaris, Linux and HP/UX SRTransport is only available as SRTransportES.
- OSX/OSX Server path is:
$(PATH_TO_SRTRANSPORT)/SRTransport.app/Contents/Resources/srtransport
- Windows NT/2000 path is:
$(PATH_TO_SRTRANSPORT)\SRTransport.app\Resources\srtransport.exe
- Solaris - Linux - HP/UX:
see xxx
This is the help information printed when you supply no parameters (or incorrect parameters) to srtransport.
usage: % srtransport [file.transport]
[SOURCE] type name flags
DEST type name flags
-version yes/NO -- show the program version
-report yes/NO -- show the transport report
-trace YES/no -- trace the transport
-reject file/directory
type : FILE XML SYBASE ORACLE JDBC EOF
types are dynamically loaded
flags : specific to each type
name : file, xml document or table
Examples:
srtransport some.transport
srtransport some.transport DEST -password
srtransport sybase employee DEST file employee.data
The SOURCE (optional) parameter allows you to specify an alternate data source. If the data source is a table,you can specify a table name, or if the source is a file, you can specify a file name or just a directory.
The DEST parameter behaves like SOURCE, but acts on the data destination.
If the transport source or destination is a database table you will have to supply the database password. For example:
srtransport my.transport -password sourcepsword DEST
-password destpsword
Before you can use srtransport in the batch mode, you must create a .transport file with the interactive SRTransport application. Once you have created the .transport file, you can execute it on the command line or in batch mode as in this example.
srtransport Invoice.transport -password mypassword &
The ampersand (&) is a CSH operator that runs the indicated command in the background. It's not necessary to use it.
By default, srtransport traces all SQL. If you want to disable this trace, then run SRTransport with the terse option, -trace no.
srtransport Invoice.transport -password [psword]
Using srtransport on platforms without WebObjects
Platforms without WebObjects (SunOS, Solaris, HPUX, Linux), srtransport reads the file SRTransport.4o. To find this file, srtransport looks in the directory identified by environment variable SRHOME.
Therefore, when you install srtransport on your non-WebObjects machine, you might copy the file SRTransport.4o in a directory such as /usr/local/lib and then set SRHOME to that directory.
Here is an example installation script:
cp srtransport /usr/local/bin
cp SRTransport.4o /usr/local/lib
setenv SRHOME /usr/local/lib
Variable SRHOME must be set before you run srtransport, so you may want to set it in you .cshrc or .login command files.
Shell script
You can string many of these commands together in a CShell script as follows.
#!/bin/csh -f
set mypassword = password
srtransport Invoice.transport -password $mypassword
srtransport LineItem.transport -password $mypassword
Srtransport returns a status value of 0 if all rows were transferred. If any rows were rejected or there were other problems, a status of 1 or greater is returned.
#!/bin/csh -f
set mypassword = password
srtransport Invoice.transport -password $mypassword
if ( $status == 0 ) then
echo "SRTranpsort succeeded."
else
echo "SRTransport failed."
endif
The .transport file
It doesn't matter where the .transport file is located or what it is named. You can specify only the filename, in which case srtransport looks in the current directory. You can specify the full file path name. You can not specify just a directory for obvious reasons.
The following are all valid specifications of the .transport file.
# the current directory
srtransport Invoice.transport
# explicit file path name
srtransport /home/data/Invoice.transport
# home directory
srtransport ~/transport/Invoice.transport
The data file
The .transport specification contains the full pathname of the .filedesc file and the data file. srtransport will open these files in their configured paths unless overridden on the command line.
To specify a data file other than the one configured in the .transport, type:
srtransport Invoice.transport [SOURCE]
~/data/newInvoices.data
The word "SOURCE" is optional and implied. "DEST" is required if appropriate.
If the directory has changed, but not the data file name itself, you can simply specify the directory. The filename is taken from the .transport and appended to the indicated directory.
To specify that the data file is in a directory other than the one configured in the .transport, type:
srtransport Invoice.transport [SOURCE] /home/data
The log file
SRTransport in the batch mode, writes its log to standard output. It does not write to the log file that is configured by the interactive SRTransport application. Therefore, to capture the log in a file, redirect standard output like this:
srtransport Invoice.transport > Invoice.log
The reject file
Like the data file and the .filedesc file, the reject file can be specified on the command line, either as a full pathname, or as a directory to which the configured filename is appended.
srtransport Invoice.transport
-reject /home/reject/Invoice.reject
srtransport Invoice.transport -reject /home/reject
In the second case above, the reject filename, taken from within the .transport, is appended to the directory /home/reject. The reject may have been configured as a file suffix rather than a full filename. In this case the suffix is appended to transport filename. In the above example the default reject filename would be Invoice.reject.
|