Difference between revisions of "fpDBExport"

From Lazarus wiki
(Created)
 
(layout)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
=== FPC ===
+
fpdbexport lets you export datasets to various formats.
 +
 
 +
== FPC ==
 
fpdbexport is part of the FreePascal FCL database modules.
 
fpdbexport is part of the FreePascal FCL database modules.
  
Line 15: Line 17:
 
* Various XML formats; see [[fpxmlxsdexport]]
 
* Various XML formats; see [[fpxmlxsdexport]]
  
=== Extensibility ===
+
== Extensibility ==
 
As indicated, developers can write their own export classes using the fpdbexport framework. An example of this is the Excel/spreadsheet format exporter in [[FPSpreadsheet]]
 
As indicated, developers can write their own export classes using the fpdbexport framework. An example of this is the Excel/spreadsheet format exporter in [[FPSpreadsheet]]
  
Line 21: Line 23:
 
There is no corresponding import to dataset code in FPC/Lazarus, but there is third party code like dbimport (https://bitbucket.org/reiniero/smalltools/src, directory dbimport). DbImport is used in the LazSQLX and TurboBird database management tools for importing CSV (like) data into datasets.
 
There is no corresponding import to dataset code in FPC/Lazarus, but there is third party code like dbimport (https://bitbucket.org/reiniero/smalltools/src, directory dbimport). DbImport is used in the LazSQLX and TurboBird database management tools for importing CSV (like) data into datasets.
  
=== Lazarus ===
+
== Lazarus ==
 
In Lazarus, the export components are not installed by default. Installation gives a ''Data Export'' tab.
 
In Lazarus, the export components are not installed by default. Installation gives a ''Data Export'' tab.
  

Revision as of 10:57, 14 November 2014

Overview

fpdbexport lets you export datasets to various formats.

FPC

fpdbexport is part of the FreePascal FCL database modules.

It provides a template class for descendants that can provide export of datasets. Also included are various ready-made descendants for:

  • CSV format
  • DBF format; see fpdbfexport
  • Fixed with text files
  • RTF/rich text format
  • Simple JSON
  • Simple XML format
  • SQL insert statements
  • TeX format
  • Various XML formats; see fpxmlxsdexport

Extensibility

As indicated, developers can write their own export classes using the fpdbexport framework. An example of this is the Excel/spreadsheet format exporter in FPSpreadsheet

Import

There is no corresponding import to dataset code in FPC/Lazarus, but there is third party code like dbimport (https://bitbucket.org/reiniero/smalltools/src, directory dbimport). DbImport is used in the LazSQLX and TurboBird database management tools for importing CSV (like) data into datasets.

Lazarus

In Lazarus, the export components are not installed by default. Installation gives a Data Export tab.

DataExportTab.png


Example

See the examples in your FPC source directory $(fpcdir)\source\packages\fcl-db\tests (see Databases#Running_FPC_database_tests), specifically testdbexport.pas.

See also