Hi All,
I have a requirement where i need to connect vertica from Perl and store the result in a variable.
For eg.
$var=vsql -c "select count(*) from tableA";
Whenever i try to fetch the value , i get the whole result as
count
-------
7
(1 row)
This whole result is stored in the variable. Iam expecting the value 7 alone to be stored in the variable. Is there an inbuilt functionality which can do it , similar to db2 -x "select count(*) from tableA" ?
VSQL command to return only the output
Moderator: NorbertKrupa
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: VSQL command to return only the output
Hi arun2986 ,
Welcome to the forums!
Please check out the post:
viewtopic.php?f=18&t=236
This should work for you:
Welcome to the forums!
Please check out the post:
viewtopic.php?f=18&t=236
This should work for you:
Code: Select all
$var=vsql -At -c "select count(*) from tableA";
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: VSQL command to return only the output
Thanks a lot Jim. That helps.