Questions tagged [vsql]

vsql is a Vertica front-end client utility for Unix-based systems that provides meta-commands and various shell-like features that facilitate writing scripts and automating a variety of tasks related to SQL.

vsql can be installed on Unix-based systems such as Solaris, HP-UX, AIX and Mac OSX. It is typically installed as part of the HP Vertica server rpm (Red Hat Package Manager).

See using vsql for more information.

54 questions
0
votes
2 answers

Can Vertica vsql have a failover host like the JDBC client

I am trying to connect to Vertica nodes through vsql using the -h parameter to specify the host IP. However, I want to specify failover nodes. According to the documentation backup hosts can be provided as a property in JDBC connection. How can I…
Vishakha Lall
  • 1,178
  • 12
  • 33
0
votes
1 answer

How to export vertica table data in sql file

I wanted to export table data in vertica and generates a SQL INSERT script. I exported table schemas and generated a SQL script. Is there any way to export table data in vertica? Thank you.
Kedar H
  • 41
  • 2
  • 9
0
votes
1 answer

Oracle's 'GENERATED ALWAYS' syntax equivalent in Vertica?

I apologize for not having much background on this question but I've been tasked with switching some of our Oracle queries to Vertica syntax and I'm having trouble understanding the documentation around the GENERATED ALWAYS Oracle command as it…
phenderbender
  • 625
  • 2
  • 8
  • 18
0
votes
2 answers

VERTICA: Need to calculate rolling DISTINCT COUNTS for past 3 months

Following is my Raw data DATE Product_id Customer_ID ---------------------------- 01-JUL-14 60 A 01-AUG-14 45 A 01-SEP-14 45 A 01-SEP-14 50 A 01-OCT-14 30 A 01-JUL-14 60 …
mr_A
  • 1
  • 3
0
votes
1 answer

SQL SUM only when each value within a group is greater than 0

Here is a sample data set: ID Value 1 421 1 532 1 642 2 3413 2 0 2 5323 I want a query that, in this case, only sums ID=1 because all of its values are greater than 0. I cannot use a WHERE statement that says WHERE Value > 0 because…
Analyst Guy
  • 115
  • 13
0
votes
1 answer

How to get datetime from interval in vertica

I am new to vertica. I am trying to get datetime of the seconds provided. I have seconds value from 1980-01-01. when I try like this: \set interval '''1199283171.887953002212558175021 SECOND''' SELECT DATE('1980-01-01') + INTERVAL :interval I am…
Jay
  • 165
  • 2
  • 14
0
votes
1 answer

Running VSQL Query in Crontab, Bash on Windows

I am trying to test a very simple VSQL query crontab job within my Bash environment in Windows 10 to automate some of the Vertica pulls I do for work on a regular basis. I made sure to set up VSQL correctly for the Bash environment specifically by…
naveman8
  • 1
  • 2
0
votes
0 answers

Vertica - Remove command execution

I have a query sequence in Vertica below: drop table [table_name]; create [table_name] as select ...; drop table [table_name]; create [table_name] as select ...; select ...; My resulting file looks like DROP TABLE CREATE TABLE DROP…
Dee
  • 401
  • 3
  • 9
  • 22
0
votes
1 answer

vsql writes CRLF at the end of output

I'm using vsql to load vertica table into csv file: vsql -c "select * from ..." ... -o file.csv I was surprised when I saw windows-like CRLF symbols at the end of the output file. It doesn't match to record or field separators because I use other…
Vikora
  • 174
  • 1
  • 6
  • 19
0
votes
2 answers

How to alter vertica database column of timestamp type to timestamp with timezone?

I have a vertica database table with column of type timestamp, now I want to alter it to type of "timestamp with time zone null". While creating the table column created without timezone but now for new users we wanted to store timezone but I am…
Nagaraj Vittal
  • 881
  • 13
  • 26
0
votes
1 answer

Remove footer from Vertica's Copy Script

I have a vertica copy script (A.copy.vsql) which is loading data into a table from a file which has HEADER, TRAILER and DETAIL RECORDS. Vertica Copy statement can skip 1 record which means I know how to remove the header. I want to know if I can…
0
votes
3 answers

Create function in vertica

I checked through many sources but cudnt get result. How to create a function in vertica to return count of all sessions in database? Can someone povide some idea or possible expamples in this topic.
Ranjana Ghimire
  • 1,785
  • 1
  • 12
  • 20
0
votes
1 answer

Vertica create view from join duplicate key columns

When I try to create a view in Vertica from a join, CREATE VIEW c AS SELECT * FROM a JOIN b ON a.key = b.key; I get an error because the key column is duplicated: ROLLBACK 5450: View definition can not contain duplicate column names "key" In…
Galen Long
  • 3,693
  • 1
  • 25
  • 37
0
votes
1 answer

How to pass multiple name value pairs to an SQL file using vsql -v from a bash script?

How to pass multiple parameters to a SQL file using vsql command line option? The following is working with asingle argument: /vsql -h${SERVER} -U${USER} -w${PWD} -A -t -P fieldsep=, -f test.sql -v date1="'"${FIRSTDAY}"'" > test.csv But I also…
ssal
  • 281
  • 4
  • 14
0
votes
0 answers

Vertica Input Query does not support SSRS Input Parameters

I am Creating SSRS reports using Vertica Data Source. I need to insert values to vertica physical table using SSRS input parameters. Build query like this: INSERT INTO Employee VALUES (@GUID, @EmpNo, @EmpName); While executing it thorows…
San
  • 11
  • 2