Exports data contained in this to the file
file; the format is specified using the
format
argument.
Note that the date format used is the one used by the connection from which the data model has been made (as the result of a SELECT statement), or, for other kinds of data models, the default format (refer to get_default) unless the "cnc" property has been set and points to a Connection to use that connection's date format.
Specifically, the parameters in the options
list can be:
true
and in case of a CSV or
TEXT_TABLE export, will add a first line with the name each
exported field (note that "FIELDS_NAME" is also accepted as a synonym)true
and in case of a CSV or
TEXT_TABLE export, will render and NULL value as the empty string
(instead of the 'NULL' string)true
, considers any invalid data (for example for the date related
values) as NULLtrue
, adds a separators lines between each column, if the export
format is TEXT_TABLE true
, adds an horizontal line between column titles and values, if the
export format is TEXT_TABLE true
, prepends a column with row numbers, if the export format is
TEXT_TABLE Warning: this function uses a DataModelIter iterator, and if this does not offer a random access (check using get_access_flags), the iterator will be the same as normally used to access data in this previously to calling this method, and this iterator will be moved (point to another row).
Upon errors false
will be returned and error
will be assigned a Error from the
DataModelError domain.
this | |
format |
the format in which to export data |
file |
the filename to export to |
cols |
an array containing which columns of this will be exported, or |
rows |
an array containing which rows of this will be exported, or |
options |
list of options for the export |
nb_cols |
the number of columns in |
nb_rows |
the number of rows in |
TRUE if no error occurred |