|
|
|
|
|
- Exporting the query content
- Type of exported items: special cases
HExportCSV (Function) In french: HExporteCSV Exports the records found in a data file (HFSQL or OLE DB), a view or a query to a CSV file. Reminder: A CSV (comma-separated values) file is a text file in which each line represents a record, with fields separated by commas. New in version 2025
HExportCSV(Customer, "C:\TEMP\Customer.csv", hExpCreation)
Syntax
<Result> = HExportCSV(<Data file> [, <CSV file> [, <Items to export> [, <Separator>]]] [, <Options> [, <Progress Bar>]])
<Result>: Boolean - Trueif the operation has been performed,
- False if a problem occurs. HError is used to identify the error.
<Data file>: Character string Name of the data file, view or query used. If this name is not specified, HExportCSV will use the last data file used by the last HFSQL function (function starting with "H"). <CSV file>: Character string Full path of CSV file to be generated. If this parameter is not specified, a <Data file>.CSV file will be generated in the current directory. <Items to export>: Optional character string List of names of items to export. Names are delimited by single quotes and separated by commas or CR characters. The names of composite key items, binary items and binary memo items are ignored. If this parameter corresponds to an empty string (""), all the items in the data file (except composite key, binary and binary memo items) are exported. <Separator>: Character string Separator used for the items. This separator corresponds to the comma (",") by default. <Options>: Optional Integer constant Specifies the creation mode of CSV file:
| | hExpBreakable | The export can be interrupted by pressing Esc. If the export is interrupted, the CSV file is valid and contains only the records exported before the interruption. | hExpCreation | If the CSV file already exists, it is overwritten. An error occurs if this option is not specified and if the CSV file exists. | hExpNoLineItemName | The first line of the CSV file will not contain the names of the items. | hExpNormal (default value) | Standard operating mode. |
<Progress Bar>: Optional control name or window name Name of ProgressBar field or window displaying CSV file creation progress. Remarks Exporting the query content To export the query content, you must initialize the query ( HExecuteQuery) before using HExportCSV. Type of exported items: special cases - If one of the exported items is an array item, each element of the array item <ARRAYITEM> is exported in a <ARRAYITEM>_<Item subscript> item.
- If one of the exported fields is of type "Spatial data", the field content is converted to WKT format..
Reminder: Compound key, binary memo and binary fields are ignored.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|