5. Populating Tables : Successful Use of the Copy Statement : Reloading Problems : Omitted Delimiters Between Fields in the Copy File
 
Share this page                  
Omitted Delimiters Between Fields in the Copy File
If you omit delimiters between fields in the data file, the record is rejected.
For example, the first record below has no delimiter between the employee’s name and her salary:
123-45-6789,01-jan-1998,Garcia33000.00,Programmer246-80-1357,02-jan-1998,Smith,43000.00,Coder
If you try to copy these records with the following COPY statement, you receive an error message because the COPY statement attempts to read “Programmer” into the “salary” field:
COPY TABLE personnel
    (ssno = CHAR(0), 
    birthdate = CHAR(0),
    name = CHAR(0), 
    salary = CHAR(0),
    title = CHAR(0)NL)
    FROM 'pers.data';