Netezza nzsql export query results to csv file

when i export query results to csv using netezza nzsql commndline, o / p is printed to file in fixed length format. those. if col is defined to be 4k length, it prints 4k length regardless of the length of the stored string in that field. As a result, the o / p file becomes huge due to the large amount of extra spaces. is there any way to get around this? I tried to trim columns, replace (field, '', '') but it didn't help.

the command I'm using:

nzsql -d {dbname} -u {username} -h {host} -c "select * from table_with_90_columns" -t -o output.csv

+3


source to share


1 answer


When using nzsql to output delimited data, specify a delimiter of your choice with the -F option and specify unformatted output with the -A option.



Or, use external tables, as they will be significantly faster for data of any significant size.

0


source







All Articles