Imports data from a file into a table.
long DatabaseImport(
|
Parameters
database
[in] Database handle received in DatabaseOpen().
table
[in] Name of a table the data from a file is to be added to.
filename
[in] CSV file or ZIP archive for reading data. The name may contain subdirectories and is set relative to the MQL5\Files folder.
flags
[in] Combination of flags.
separator
[in] Data separator in CSV file.
skip_rows
[in] Number of initial strings to be skipped when reading data from the file.
skip_comments
[in] String of characters for designating strings as comments. If any character from skip_comments is detected at the beginning of a string, such a string is considered a comment and is not imported.
Return Value
Return the number of imported strings or -1 in case of an error. To get the error code, use GetLastError(), the possible responses are:
Note
If there is no table named table, it is generated automatically. Names and field types in the created table are defined automatically based on the file data.
See also