You are here: Native API > Reference Manual > Utility Descriptions > dbexp

dbexp

Database export utility.  The database export utility is capable of exporting data from the RDM Embedded database into either an ASCII text file or an XML file.  While this is one utility capable of working with either format, this section is broken into two parts for clarity, one dealing with the XML format, and the other dealing with the ASCII format.

Common Options

-q Quiet - suppresses all output (except errors)
-stderr filename Specify redirection of stderr into filename.
-stdout filename Specify redirection of stdout into filename. Cannot use -v with this option.
-docroot path [non-RPC configuration only] Specifies the document root when in Direct-Link or Standalone configuration.
-v Verbose - shows detailed output of the operations performed on the database.
-openmode mode Spedify the open mode to use for the database (default 's' using ROT).

XML

Prototype

dbexp [-docroot path] [-xml] [-xsd|-dtd]
      [-o <filename>] [-openmode mode]
          dbname [recname ...]

Description

This utility exports data from database dbname to an XML file.  By exporting data into XML format, consumers of the data can be RDM Embedded (e.g. for database restructuring or archiving), RDM Server, RDM Mobile, or other XML consumers, including other database products such as ADO.NET.  The XML content created by the dbexp utility will allow reconstruction of sets (in the case of RDM Embedded as the consumer), or interpretation by any normal XML consumer.

Options

-xml Instructs dbexp to export data to an XML file.
-xsd Instructs dbexp to create an XML Schema with name <dbname>.xsd.
-dtd Instructs dbexp to create an XML DTD with name <dbname>.dtd.
-o filespec Writes output to specified filespec instead of dbname.xml.

ASCII

Prototype

dbexp [-docroot path] [-btxt] [-r] [-m] [-d] [-e esc_char] 
      [-s separator] [-x] [-openmode mode]
          dbname [recname ...]

Description

This utility exports data from database dbname to an ASCII text file that can then be moved to another computer, or used as input into other tools that read ASCII formatted files (for example, dbimp). The dbexp utility writes all data from each record type to a separate file; it is the record name with file extension .txt. If a record name, recname, is specified on the command line, then only that record type's occurrences are exported. The created files will consist of one text line per record occurrence with commas separating the data fields.

The dbexp utility has two ways of printing extended ASCII characters to the output files when a country table is not being used. The default is to write out the octal value. Since dbimp cannot handle this method, the -x option can be used to print the extended ASCII character as the character. For example, ASCII 2 would be printed as "\002" without the -x and as a smiley face with the -x option. (When a country table is used and the input character has been mapped to something, the "display as" character will be printed to the text file instead of the "input" character.)

Options

-btxt Export blob fields as ASCII text. Non-SQL databases will treat blob fields as binary data and export the contents of the field as an array of hex characters.
-r Prints a record's database address as the first field of each record occurrence.
-m Prints the database addresses of the owners of all sets for which the record is a member.
-d Causes a database address to be printed as long integers, rather than in the standard format.
-e ch Changes the escape from a backslash ('\') to character ch. White space between the "e" and the character is optional.
-s ch Changes the field separator character from a comma to character ch. White space between the "s" and the character is optional.
-x Prints extended ASCII characters in octal.

Copyright © 2011, Raima Inc. All rights reserved.