Difference between revisions of "fpDBExport"

From Lazarus wiki
m (FPC)
Line 15: Line 15:
* SQL insert statements
* SQL insert statements
* TeX format
* TeX format
* Various XML formats; see [[fpxmlxsdexport]]
* Various XML formats; see [[fpXMLXSDExport]]
== Extensibility ==
== Extensibility ==

Revision as of 13:56, 14 November 2014


fpdbexport lets you export datasets to various formats.


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


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


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.


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



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