Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

Vsql Output in .xlsx



Can any one help me what is the sentx to get data in .xlsx format thru vql.




  •  Why don`t you create an ODBC connection to your Vertica database and then connect form Excel to your db ! 

  • I need to create a cron job (In Linux) and send that output to users.



  • Here is some idea that might work for you.

    - export the content of the data into csv format, any separetor would work.

    - here i use | , the trick is the "sep=|"  (it tell what is your delimiter)make sure you have this as the first line of the file, so when they open it in excel all should be aligned. 

    vsql -U dbadmin -w password -F $'|' -At -c "SELECT * FROM table_name"  > '/tmp/bla.csv'
    sed -i '1s/^/sep=|\n/' /tmp/bla.csv

    The sed command will add the delimiter as the first line in the file.



     This should do the trick :).


  • Wow Superb!..

  •  Happy to hear this helped :)

    You might wanna cleanup the last row of the files since is going to show the number of rows.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.