ubdump – dump table records


ubdump – dump UNIBASE table


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


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.



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.

Output dates in YYMMDD format instead of the usual DD.MM.YY format.

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.
-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.

Dump table in UDF (Universal Dump Format)/csv. See ubbatch(1) for details.

Return count of number of records

Debug output.
-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

This tells ubdump to ignore the normal start up file checking. This option is useful for recovering corrupt files.
-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.

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.

Delete records as they are dumped.



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