Hi,
I am trying to export my query result to csv file by using below command. When i try to execute below command, file is exporting in linux machine where the vertica installed
But i just want to export file into my local machine.
Is it possible with vsql?
vsql -U test -d db_name -h 1.0.0.0 -w vertica -c "select * from export_query_result " -Aq -P footer=off -F ',' -o "/tmp/exaple.csv"
Can i execute above command using .NET?
Export query result to csv file
Moderator: NorbertKrupa
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: Export query result to csv file
It is not. You can either copy the file or use an application to extract the data.prsekhar13 wrote: But i just want to export file into my local machine.
Is it possible with vsql?
Checkout vertica.tips for more Vertica resources.
Re: Export query result to csv file
You could install a vsql client on your local machine and exeute vsql from there.
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC
Vertica Consultant, Zazz Technologies LLC
-
- Newbie
- Posts: 6
- Joined: Wed Feb 26, 2014 9:05 am
Re: Export query result to csv file
Thank u very much for your reply .It will be useful for me.
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: Export query result to csv file
Would have never thought of that. Has to be a Linux machine though?scutter wrote:You could install a vsql client on your local machine and exeute vsql from there.
Checkout vertica.tips for more Vertica resources.
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: Export query result to csv file
Whenever you install the Vertica Windows client package, vsql is also installed!
Example:
Example:
Code: Select all
C:\Users\knicely>vsql -U dbadmin -h 10.10.10.1 -c "select * from dual;" -o e:\dual.txt
C:\Users\knicely>more e:\dual.txt
dummy
-------
X
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Re: Export query result to csv file
There’s also a vsql client for osx.
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC
Vertica Consultant, Zazz Technologies LLC