Reputation: 397
I am trying to extract data from Snowflake and external S3 stage the data in txt file format that can be sent over to vendor using SFTP. But I am facing SQL compilation error -
File format script:
create or replace file format my_format
type = txt
field_delimiter = '|'
skip_header = 0
null_if = ('NULL', 'null')
empty_field_as_null = true
Please advise how can we unload data to txt format in S3 external stage.
Upvotes: 0
Views: 2554
Reputation: 11046
Just change the txt to csv and the file_extension to txt:
create or replace file format my_format
type = csv
field_delimiter = '|'
skip_header = 0
null_if = ('NULL', 'null')
empty_field_as_null = true
file_extension = 'txt'
Although it shows CSV, it's actually text with delimited fields and your pipe (vertical bar) overrides use of the comma as a column delimiter.
Upvotes: 3