Data export to a file from table
Hello i had an scenario where i need to copy data from a table to a file. So can some one suggest me a way to do this . (Can u please suggest a way with out writing a shell script if that is only the way please enclose an example ) Thanks
0
Comments
$ vsql -F'","' -P footer=off -Aqnc "select * from tbl" | awk '{print "$ vsql -F'","' -P footer=off -Aqnc "select * from tbl" | awk '{print "\042"$0"\042"}' > /path/to/file.csv 42"$0"$ vsql -F'","' -P footer=off -Aqnc "select * from tbl" | awk '{print "\042"$0"\042"}' > /path/to/file.csv 42"}' > /path/to/file.csv
With compression$ vsql -F'","' -P footer=off -Aqnc "select * from tbl" | awk '{print "$ vsql -F'","' -P footer=off -Aqnc "select * from tbl" | awk '{print "\042"$0"\042"}' | gzip -f > /path/to/file.csv.gz42"$0"$ vsql -F'","' -P footer=off -Aqnc "select * from tbl" | awk '{print "\042"$0"\042"}' | gzip -f > /path/to/file.csv.gz42"}' | gzip -f > /path/to/file.csv.gz