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
1
vote
2 answers

vsql with multiline recall

I'm on osx, and I installed vsql by following this. When I input a multiline statement into vsql, then hit up, I only recall one line of the statement at a time. I would like to be able to recall and rerun multiline statements with the up arrow…
Max Bileschi
  • 2,103
  • 2
  • 21
  • 19
1
vote
1 answer

Create table with a variable name

I need to create tables on daily basis with name as date in form at (yyMMdd), I tried this : dbadmin=> \set table_name 'select to_char(current_date, \'yyMMdd \')' dbadmin=> :table_name; to_char --------- 150515 (1 row) and then tried to create…
Kundan Jha
  • 74
  • 9
1
vote
2 answers

Globally Unique Identifier in Vertica

I am going to create some table at Vertica Database on which i have to give Global Unique Identifier to identify each row uniquely. Please suggest how to do it?
San
  • 11
  • 2
1
vote
1 answer

How to delete 1st column in SQL Database using R

This is a simple example Basket rownames fruit quantities 1 apple 3 2 orange 4 3 tomatoes 6 4 watermelon 7 5 durian 8 How…
xavier
  • 31
  • 1
  • 5
1
vote
2 answers

vsql/vertica, how to copy text input file's name into destination table

I have to copy a input text file (text_file.txt) to a table (table_a). I also need to include the input file's name into the table. my code is: \set t_pwd `pwd` \set input_file '\'':t_pwd'/text_file.txt\'' copy table_a ( column1 ,column2 …
user3435213
  • 11
  • 1
  • 2
1
vote
2 answers

How can I join a record with the closest prior date in another table?

I want to produce a sales report showing the price of each product at the time it was sold. The pricing is stored in a separate price history table, so I want to join with the most recent price that is prior to the sale date. I have an idea of how…
Matt
  • 1,284
  • 14
  • 22
0
votes
3 answers

How to get Notice and Hint logs of vertica cli into a file

this is my vsql cli command. Trying to store memory data and time into an output file. /opt/vertica/bin/vsql -U xxxx -d Xxxx --password='xxxx' --timing -c 'profile xxxxxxxxxxxxxx' -o sample.log vsql: warning: extra command-line argument "i"…
0
votes
2 answers

Vertica GET_COMPLIANCE_STATUS() discrepancy

We use Vertica Community Edition which allows us to store data up to 1 TB. Vertica is hosted on-premise and we have allocated 153 GB for it to use, out of which 57 GB (39%) is used so far. When I run SELECT GET_COMPLIANCE_STATUS(), it shows I have…
Nikhil
  • 621
  • 1
  • 13
  • 25
0
votes
1 answer

Vertica's vsql.exe returns errorlevel 0 when facing ERROR 3326: Execution time exceeded run time cap

I am using vsql.exe on an external Vertica database for which I don't have any administrative access. I use some views with simple SELECT+FROM+WHERE queries. These queries 90% of the time work just fine, but some times, randomly, I get this…
Andrew
  • 7,602
  • 2
  • 34
  • 42
0
votes
1 answer

Trying to copy data from vertica table into csv using vsql

Was trying to export data from vertica table to CSV file, but some data contain comma "," in values which pushed to other column. vsql -h server_address -p 5433 -U username -w password -F $',' -A -o sadumpfile_3.csv -c "select full_name from…
SQLLER
  • 29
  • 8
0
votes
2 answers

How to aggregate rows in the range of timestamp in vertica db (vsql)

Suppose I have a table with data like this: ts | bandwidth_bytes ---------------------+----------------- 2021-08-27 22:00:00 | 3792 2021-08-27 21:45:00 | 1164 2021-08-27 21:30:00 | 7062 2021-08-27 21:15:00 | 3637 …
0
votes
1 answer

VSQL: Concatenate two values in same column from same table

I have a table that looks like the following: email | first_name ----------------------+------------ ------@diffem.com | Matthew ------@email.net | Susan ------@email.net | Thomas ------@email.com |…
ChristineB
  • 11
  • 1
0
votes
1 answer

How to convert address in IPv6 to number using Vertica

I have a table in Vertica db with column ip of type string that holds both formats of ipv4 and ipv6. I need to transform the string representation of the ip to a number as it is done for example here -…
geronimo
  • 49
  • 1
  • 5
0
votes
3 answers

Vertica sql overwrite data on insert

How to overwrite the table each time there is an insert statement in a vertica? Consider: INSERT INTO table1 VALUES ('My Value'); This will give say | MyCol | ---------- MyValue How to overwrite the same table on next insert statement say INSERT…
supernatural
  • 1,107
  • 11
  • 34
0
votes
1 answer

How to create table-valued functions in Vertica SQL?

Does anyone know how to create table-valued function in Vertica SQL? For example, I want to create a function f_student_name() that takes in input: student_id to return output: student_name in a query, extracting directly from a students table,…
quinn
  • 31
  • 1
  • 5