NAME
ubbatch – batch load data into a table
SYNOPSIS
ubbatch -[0 A D P* Y* a*-array* b -body* c d e* f* -head* -join* n# o q s -tail* u] <table>
DESCRIPTION
ubbatch
batch loads data into UNIBASE files.
You pass records for import to ubbatch
‘s standard input by piping data or by redirecting input.
ubbatch supports a number of input formats: records, csv, and Unibase A format.
Each input record is normally in the same format as the record stored in the UNIBASE table. This means that expressions and unions must not be part of the input record.
Records comprise lines of text, and line feeds delineate each one. Each field’s width aligns with the specification in the Data Dictionary.
Some of the command line options allow for different data formats.
FLAGS
FLAG | ARGUMENT | TYPE | DESCRIPTION |
---|---|---|---|
-0 | Use attribute/value format but don’t pad with zeroes This format is identical to the -A format below, except it does not pad sequence numbers or counters with zeros, and does not initialize boolean fields. | ||
-A | Use attribute/value format IIn this format, each attribute (field) in a record occupies a separate line. The format divides each line into two parts. The first part, ending with a comma, identifies the attribute name; the second identifies the attribute value. The format sets missing attributes to their default values. Each record is terminated by a line starting with “>”. | ||
-D | Alternate Date Format This option allows for the alternative date format CCYYMMDD. Normally, all dates are expected to be in the format DD.MM.CCYY (or DD/MM/CCYY). Using this option reads dates in the alternate format. | ||
-P | pipe | text | Named Pipe Input ubbatch will read its input from the name pipe “pipe”. To operate in this mode, |
-Y | dictionary | text | Use alternative data dictionary ubbatch will use dictionary instead of the normal data dictionary. |
-a | format | text | Print record format as each record is loaded This is a standard record format. eg [customerId] - [customer] As each record is loaded this format is printed. Note: If new records get a new sequence number, the new sequence number will be printed if requested. Using this option will suppress other reporting formats such as the record count. |
–array | format | text | Format out for new records as an array Before any outout “[” is printed After all new records “]” is printed In between each new record the optional “–join” format is printed |
-b | CSV format. This option allows ubbatch to read CSV dump formats. This format presents each record as a single line of ASCII text. It separates fields with commas and encloses text and date fields in double quotes (" ) while leaving numbers unenclosed.e.g “FRED SMITH”,”10 JOHN ST”,”TOWN”,49,3.72 | ||
–body | format | text | Specify this as the format for echoing output with every new record. |
-c | Count Only Only print the total record count. This option suppresses the normal “Records Processed” message and instead prints a single number showing the total records processed. This switch is ineffective if the ‘-s’ switch is also used. | ||
-d | Debug This option gives a debug output. Asubbatch reads the Data Dictionary, it echoes each line to the screen. This output helps you observe and correct errors at the exact point they occur. | ||
-e | file | text | Error Log File When records fail to write because of an error, ubbatch normally directs these records to /dev/null .With this option they are saved in “file”. |
-f | separator | text | Input Record Field (Attribute) Separator. Instead of fixed-length input records, this option allows variable-length records. A field separator delimits each field; in the example below, this is the character “ : “.
|
–head | format | text | Format to echo before any new records |
–join | format | text | Format to add after each new record when array format chosen |
-n | number | number | Records Processed Interval Print record count every number records instead of default 10. |
-o | Standard Output This flag directs ubbatch to write records to standard output instead of the table.This is most useful when used as a part of a pipeline. eg
The record on standard output appears exactly as | ||
-q | Quiet Mode When you provide this flag, ubbatch does not write any output. | ||
-s | Allocate Sequence Numbers This option causes ubbatch to allocate new sequence numbers when it adds records to the file.As Records processed: 10 When you specify the | ||
–tail | format | text | Print format after all new records |
-u | Ignore duplicate records Normally, ubbatch records an error if a record contains a duplicate key value when the Data Dictionary specifies a unique key for that table.Using this flag, ubbatch will act as if it inserted the record successfully. |