Fixed length :
Code: Select all
cat filename.txt | vsql -h myverticanode -u myuser -w passwd -c "set role all; copy schema.tablename from stdin FIXEDWIDTH COLSIZES(3,4,2,4) ABORT ON ERROR DIRECT"
Code: Select all
cat filename.txt | vsql -h myverticanode -u myuser -w passwd -c "set role all; copy schema.tablename from stdin delimiter '|' NULL '?' TRAILING NULLCOLS ABORT ON ERROR DIRECT"
Fixed length :
Code: Select all
cat filename.txt | vsql -h myverticanode -u myuser -w passwd -c "set role all; copy schema.tablename from local stdin FIXEDWIDTH COLSIZES(3,4,2,4) REJECTED DATA '/mypath/filename.rejections' EXCEPTIONS '/mypath/filename.exceptions' ABORT ON ERROR DIRECT"
Code: Select all
cat filename.txt | vsql -h myverticanode -u myuser -w passwd -c "set role all; copy schema.tablename from local stdin delimiter '|' NULL '?' REJECTED DATA '/mypath/filename.rejections' EXCEPTIONS '/mypath/filename.exceptions' TRAILING NULLCOLS ABORT ON ERROR DIRECT"
When I execute the above cmd for delimited text, it throws error :
ERROR 0: client connection I/O error.
Whereas it works for a fixed length file. If I do not use COPY FROM LOCAL then I cannot create EXCEPTION and REJECTION file.
Can you please help in solving the above issue?