Exporting and Importing Delimited Data
Go Up to Importing and Exporting Data
Use the TIBSQL
component, along with TIBOutputDelimitedFile
and TIBInputDelimitedFile
objects to perform batch exports and imports of data to and from a database into pipe-tilde (|~) and Z
-W
-F
delimited files.
Use a SQLSELECT
statement to export the data to the delimited file, and an INSERT
statement to import the delimited data into another database.
By default, the column delimiter is a tab, and the row delimiter is a tab-line feed (Z
-{{{1}}}
-F
). Use the ColDelimiter
and RowDelimiter
properties to change the column delimiter and row delimiter, respectively.
For example, to set the column delimiter to a comma, you could use the following line of code:
DelimOutput.ColDelimiter := ',';
- Note: Columns may contain spaces before the delimiter. For example, if you have a column called NAME which is defined as a CHAR(10), and the name “Joe” is in that column, then “Joe” will be followed by 7 spaces before the column is delimited.