Hi,
Can we set the output of the query to a variable like,
CNT=SELECT COUNT(*) FROM DATABASENAME.TABLENAME;
I know, we have
\set CNT 'SELECT COUNT(*) FROM DATABASENAME.TABLENAME'
\echo :CNT
SELECT COUNT(*) FROM DATABASENAME.TABLENAME
But i need to output of the query in the CNT, i need the number value, not the select statment in the CNT variable.
Is this doable in vertica?
Thank you,
Yaseen
Assignment of query output to a variable
Moderator: NorbertKrupa
-
- Newbie
- Posts: 1
- Joined: Sat Aug 06, 2016 7:19 pm
Re: Assignment of query output to a variable
Some examples - let me know if you need help with these:
http://www.vertica-forums.com/viewtopic.php?t=1626
https://community.dev.hpe.com/t5/Vertic ... d-p/221983
http://www.vertica-forums.com/viewtopic.php?t=1626
https://community.dev.hpe.com/t5/Vertic ... d-p/221983