The dbdump utility writes the data in a database to a file. The format of the exported data is specified by the record description given in an input command file.
Operational Model:
The dbdump command accepts the commands file name, the database name and a command option.
Syntax
dbdump -f commands_file [-u user_name] [-a password] [-n] [‑z] [-p] [‑l] database_name
Options
No errors in the commands file.
SELECT RTRIM(cm_custnumb),...
The default behavior of dbdump results in the following statement, which would cause a syntax error:
select "rtrim" ( "cm_custnumb" ) ,...
Using the dbdump -p switch results in this statement, which does not cause an error:
select rtrim ( cm_custnumb ) ,...
Automatic Record Definition
Customers have a need to export all data in a CSV format. dbdump is great for this purpose. (In general, dbdump primary usage is with SELECT * FROM ...) However, with large tables, there is a lot of setup work to create the DEFINE RECORD information. For example, for a table with more than 100 columns, they have to manually describe the complete output structure for all fields.
In V11.5 and later we have introduced a new syntax in the DBDUMP script to automatically generate the record definition. The syntax definition for the commands file is as shown:
dbdump_commands:
define_record_statement
for_record_statement
where define_record_statement is either the following (existing syntax):
DEFINE RECORD record_name
[ OF FIXED LENGTH record_length
AS (
field_name position_specification
type_specification,
...
)
]
[ FIELD DELIMITER delimiter_char ]
[ RECORD DELIMITER delimiter_string ]
or the following (new added syntax):
AUTODEFINE RECORD record_name
[ FIELD DELIMITER delimiter_char ]
[ RECORD DELIMITER delimiter_string ]
[FIELDS PER LINE number ];
Unicode
The dbdump Data Unload and dbload Data Load utilities properly dump and load data out of a Unicode-enabled FairCom DB SQL Server. The commands file must be in ASCII format. The output file generated by dbdump is in Unicode format with an optional Byte Order Mark (BOM) indicating the Unicode encoding form (using the ‑B command-line switch).
The input file for dbload needs to be in Unicode (native "wchar" encoding form) with an optional BOM, in which case the utilities check for the proper format.
See Also