UNIBASE

ubdump – dump table records

NAME

ubdump – dump UNIBASE table

SYNOPSIS

ubdump -[0 A C* D L# M# S U* X{H|O} Y* a* -array* b -body* c -csv d f* -head* i -join* k* l* m* p* r s* -subtotal* -tail* -total x] <table>

DESCRIPTION

Dumps all the stored fields from the records in the UNIBASE table in a format suitable for use by ubbatch, or for export to another database, or for archiving.

FLAGS

FLAGARGUMENTTYPEDESCRIPTION
-0Output field name (and ,) even if field is empty. ie -A but for all fields.
-A


Use attribute/value format. In this format each attribute (field) in a record is on a separate line. The line is divided into two parts. The first part (ending with a ‘,’) is the attribute name, while the second is the attribute value. The value is trimmed. i.e. leading/trailing spaces as appropriate are deleted. Sequence numbers and counters have leading zeroes deleted. Each record is terminated by a line starting with “>”.
-C<condition>UNIBASE expressionOnly dump records that meet the condition.
-D

Output dates in YYMMDD format instead of the usual DD.MM.YY format. Also works for century dates.
-L<new length>numberOverride record length. Used in conjuction with -i and -r for data recovery
-M<records>numberLimit output to max records as given
-S

Read records from stdin. The records are assumed to be in the same format as they are stored. ie dates are in CCYYMMDD format. This option is compatible with the ubbatch -o option.
-U<update>UNIBASE update expressionApply update to all records dumped.   Multiple updates (no limit) may be requested.
Updates are in the same format used in ubreport.
-X{H|O}Optional XML extrasDump record in XML format.
Each record is surrounded by <table name>…</table name>

If H is given then a proper XML header is created:
<?xml version=”1.0″?>
<unibase>
<application name>
records…
</application name>
</unibase>

If O is given then the records “owned” by this record are printed in an XML hierarchy. This option is not yet implemented.
-Ydictionarytext file nameUse dictionary as an alternative data dictionary.
-aformattextDump in a format similar to ubreport.   e.g ubdump -a “Category [cat] – Description [desc]” category The “” must surround the format to stop any futher shell substitution.
–arrayformattextLike -a except the output is surrounded by ‘[‘ and ‘]’ and each format is on a separate line.
If –join is given then the separator line will be the join string.
-b

Dump table in UDF (Universal Dump Format) or csv. See ubbatch(1) for details.
Note that this format first puts out a line of field names in csv format and then the records.
–bodyformat textFormat for body of record. Normally used in conjunction with –head and/or –tail.
-c

Return count of number of records
–csvOutput using csv format (including heading line). Same as -b
-d

Debug output. Painfully verbose account of what ubdump is doing.
-fseparatortextThis option will dump the UNIBASE table using separator as the field separator and all fields will be trimmed (ie no trailing spaces for text and no leading spaces for numbers). For example, to dump a UNIBASE file with a colon (“:”) between the fields:   ubdump -f: file
–headheading for dumptextprint this before dumping the table. May include system attributes such as [system.century]
-i

This tells ubdump to ignore the normal start up file checking. This option is useful for recovering corrupt files.
–joinjoin texttext text to display between records in –array format.
NB This is not printed after the last record.
-k<key>UNIBASE keyIf you want a dump of a UNIBASE file in a different order to the default primary key order use this option. This is particularly useful for recovering files when a key is corrupt, such as may happen when the disk runs out of space. ‘key’ is the text description of the key. e.g.   ubdump -k “stock no” stock
-lmatchtextIf dumping using “-m”, stop when the key is match.
-mmatchtextOnly dump those records whose key starts with match.
-ppatterntextThis is the same as the -m option except the pattern is applied to the sort key given in the -s option.   NOTE: Both -m used (with -k) and -p (used with -s) may be used simultaneously. -m to dump a range of records and -p to select only certain key values for a new sort key.
-r

Ignore the keys and dump records from the data file only. This is much quicker if the order of records dumped is not important. It is also useful if a key file has been corrupted.
-s<key>UNIBASE key definitionDump table with key at start of record. Key does not have to be an existing key and may include expressions. If -f is also given then key is separated from the record by the separator character. Note that expressions may not be used in the sort key if the i flag is used.
–subtotal<key>textPrint record format when key changes
–tailformattextPrint text at end of report
–totalPrint format as a total for report
-x

Delete records as they are dumped.

ERRORS

EXAMPLE

To dump an ordinary file using the default key:

ubdump orders

To dump all customers with a delete field set to “Y” and remove them from the file at the same time:

ubdump -k delete -m Y -x customer

SEE ALSO