To insert the data stored in a file into a database table, the LOAD statement is used.
Input file |
A character expression that returns the name of the input file and its relative path if necessary |
Delimiter |
A quoted string (or a CHAR, STRING, or VARCHAR variable) containing a delimiter symbol |
Variable |
A CHAR, STRING or VARCHAR variable containing an INSERT clause |
INSERT clause |
A CHAR, STRING, or VARCHAR variable containing an INSERT clause |
When you specify a file name, be careful with its case.
UNIX is case-sensitive, so it will treat files which names come in different cases as separate files.
The LOAD statement must contain the INSERT clause to indicate the table to which the data should be loaded. The LOAD statement adds new rows to the specified table or view, it does not erase or delete the data already existing in this table or view. The LOAD statement cannot be used in the PREPARE statement. A row that has the same key as an existing row cannot be added to a table.
To execute the LOAD statement the user must have the insert privileges for the specified table.