This topic describes how to export data from any database to dBase (DBF) in Exportizer sofware, either from graphic user interface (GUI) or command line.
Export Conditions
Before you start, please consider the following:
- To export one table from a single-table file databases (e.g. Paradox, dBase, CSV etc.), Exportizer standard edition is enough to perform the task. To export more than one table at a time, Exportizer Enterprise is required. When using ODBC sources of any kind and one dataset, Exportizer Pro can be used.
- All involved components (Exportizer, database servers/clients, ODBC drivers etc.) must have the same architecture (32-bit or 64-bit).
Note: If your operating system is 64-bit, you can install both Exportizer 32-bit and Exportizer 64-bit and use them independently.
Export Steps (GUI)
- Launch Exportizer.
- Register and open your source database.
- Choose a table or tables to export and/or write and execute your SQL query or queries. Note: Exporting multiple datasets at a time is available in Exportizer Enterprise only. In Exportizer Enterprise, you can export a mix of open tables and SQL query results in one export operation.
- Choose the corresponding action from Export menu or click Export button .
- Choose the destination format. For dBase, you have two options: dBase (DBF) and Database. They work completely different. Try both and compare. The first one is simpler to configure and faster, but does not support dBase versions greater than V. And the latter one requires registering the target database; if you already did that, just select the database from the database list, otherwise, click '...' button to register it.
- Specify the export parameters.
- Click Next.
Specify the source-to-target table and/or field mappings.
In field mappings, you create the correspondence between the source and target columns. In addition to source table columns, you can also use calculated fields specified by formulas.
In table mappings (when exporting multiple datasets), you create the correspondence between the source datasets (tables and/or queries) and target DBF files. You can also specify nested field mappings for each table/file pair.
- Click Export.
Converting data to DBF from Command Line
Below are some examples of exporting different types of data to DBF format.
1. Exporting a CSV file to dBase (DBF) format in Exportizer 32-bit:
"C:\Program Files (x86)\Vitalii Levchenko\Exportizer 8\exptizer.exe" /export /ExportType=DBF /ExportMode=REPLACE+INSERT /FieldMappings=ID=ID;FIRSTNAME=FIRSTNAME;LASTNAME=LASTNAME;CITY=CITY;COUNTRY=COUNTRY /dbfVersion=5 "/encoding=DBASE ENU CP437" /IncludeMemo /SrcDBInterface=ado /SrcDB=C:\TEST\CL_ADDR.csv /TrgDB=C:\TEST\CL_ADDR.dbf
2. Exporting all CSV files from a certain folder to dBase (DBF) format in Exportizer Enterprise 32-bit (target file names are copied from the source ones, except extensions):
"C:\Program Files (x86)\Vitalii Levchenko\Exportizer Enterprise 9\exptizer.exe" /export /ExportType=DBF /ExportMode=REPLACE+INSERT /dbfVersion=5 "/encoding=DBASE ENU CP437" /IncludeMemo /SrcDBInterface=ado /SrcDB=C:\TEST\*.csv /TrgDB=C:\TEST\*.dbf
3. Exporting several CSV files from a certain folder to dBase (DBF) format in Exportizer Enterprise 32-bit (target file names are specified explicitly in a separate table mappings file):
"C:\Program Files (x86)\Vitalii Levchenko\Exportizer Enterprise 9\exptizer.exe" /export /ExportType=DBF /ExportMode=REPLACE+INSERT /TableMappingsFile=C:\TEST\TblMapping.xml /dbfVersion=5 "/encoding=DBASE ENU CP437" /IncludeMemo /SrcDBInterface=ado /SrcDB=C:\TEST /TrgDB=C:\TEST
4. Exporting a table from PostgreSQL database to dBase (DBF) format in Exportizer Enterprise:
"C:\Program Files (x86)\Vitalii Levchenko\Exportizer Enterprise 9\exptizer.exe" /export /SrcDBUserName=dwh /SrcDBPassword=dwh_password /ExportType=DBF /ExportMode=REPLACE+INSERT /dbfVersion=5 "/encoding=DBASE ENU CP437" /TrimTrailingSpaces /IncludeMemo /SrcDBInterface=fd /SrcDBKind=DSN /SrcDBDriver=POSTGRESQL /SrcDB=dwh_test /SrcServer=hjkjkhkk.rds.amazonaws.com /SrcPort=5432 /SrcTableName=myschema.campaigns /TrgDB=C:\MyData\campaigns.dbf
5. Exporting a table from SQLite file to dBase (DBF) format in Exportizer Enterprise:
"C:\Program Files (x86)\Vitalii Levchenko\Exportizer Enterprise 9\exptizer.exe" /export /ExportType=DBF /ExportMode=REPLACE+INSERT /FieldMappings=ID=ORDERID;CUSTID=CUSTID;SALEDATE=SALEDATE;TOTALSUM=TOTALSUM;TAXRATE=TAXRATE;INVOICE=INVOICE /dbfVersion=5 "/encoding=DBASE ENU CP437" /TrimTrailingSpaces /IncludeMemo /SrcDBInterface=fd /SrcDBKind=FILE /SrcDBDriver=SQLITE /SrcDB=C:\MyData\TestSQLiteDb.db /SrcSharedCache=True /SrcLockingMode=Exclusive /SrcTableName=orders /TrgDB=C:\MyData\orders.dbf
6. Converting SQL result set from Interbase to DBF using an action file:
/export
/SrcDBUserName=sysdba
/SrcDBPassword=masterkey
/ExportType=DBF
/ExportMode=REPLACE+INSERT
/FieldMappings=ID=ORDERID;FIRSTNAME=FIRSTNAME;LASTNAME=LASTNAME;CITY=CITY;COUNTRY=COUNTRY
/dbfVersion=5
/encoding=DBASE ENU CP437
/TrimTrailingSpaces
/IncludeMemo
/SrcDBInterface=fd
/SrcDBKind=FILE
/SrcDBDriver=INTERBASE
/SrcDB=C:\MyData\TEST.GDB
/SrcOSAuthentication=No
/SrcVendorLibrary=C:\Program Files (x86)\Embarcadero\Studio\15.0\InterBaseXE3\bin\gds32.dll
/SrcSQLFile=C:\MyData\customers.sql
/TrgDB=C:\MyData\CUSTOMER.dbf
If you save the file, for example, as C:\MyData\ExportAction_IB2DBF.txt, then your command line will look like:
"C:\Program Files (x86)\Vitalii Levchenko\Exportizer Enterprise 9\exptizer.exe" /silent /ActionFile=C:\MyData\ExportAction_IB2DBF.txt
See also
Practical Cases
- Exporting Data to dBase
- Exporting Large Tables
- Exporting Calculated Fields
- Exporting BLOBs to Individual Files
- Exporting to HTML Using Template
- Importing Database Files from Explorer