Tomasz Tomas
Tomasz Tomas

Reputation: 11

Problem with CSV import from stage (curly brackets)

I am trying to import csv file from stage and I am getting the error below

Found character '}' instead of field delimiter ';'

My data in csv. looks like

0911220;NULL;{{lorem.ipsum}};{{bla.bla}}

I don't know what to do. I don't have anything related to curly braces set in File Format. Should I change something there?

The file format is:

ALTER FILE FORMAT "RAW"."CRM".CSV_SEMICOLON_QUOTES_HEADER
    SET
    COMPRESSION = 'AUTO'
    FIELD_DELIMITER = ';'
    RECORD_DELIMITER = '\n'
    SKIP_HEADER = 1
    FIELD_OPTIONALLY_ENCLOSED_BY = '\042'
    TRIM_SPACE = FALSE
    ERROR_ON_COLUMN_COUNT_MISMATCH = TRUE
    ESCAPE = 'NONE'
    ESCAPE_UNENCLOSED_FIELD = 'NONE'
    DATE_FORMAT = 'AUTO'
    TIMESTAMP_FORMAT = 'AUTO'
    NULL_IF = ('\\N');

And method of import:

copy into "..." ( list of columns ) 
    FROM @stage_name files = ( 'file.zip') file_format = ( 
        format_name=CSV_SEMICOLON_QUOTES_HEADER compression=GZIP); 

Upvotes: 1

Views: 374

Answers (1)

mahtabuzzaman
mahtabuzzaman

Reputation: 26

The file format name is wrong in the copy into ... query.

The file format you created is named as CSV_SEMICOLON_QUOTES_HEADER2. but in your query you wrote ..HEADER instead of ..HEADER2

Upvotes: 1

Related Questions