Page 1 of 1
-a vs -e option of vsql
Posted: Thu Jan 29, 2015 2:12 pm
by debfawn
Can someone explain to me what is the difference between the -a (Echo all input from script) and -e (Echo commands sent to server) command line options of vsql? They seem to do the same exact thing!
Re: -a vs -e option of vsql
Posted: Thu Jan 29, 2015 2:26 pm
by JimKnicely
Hi,
The
-e (just SQL statements) produces a subset of the
-a (everything) option.
I put some examples below where each example uses the following sql script file as input:
Code: Select all
[dbadmin@vertica01 ~]$ cat /home/dbadmin/test.sql
-- Do some stuff
\set table_name dual
select * from :table_name;
-a Example:
Code: Select all
[dbadmin@vertica01 ~]$ vsql -a -f /home/dbadmin/test.sql
-- Do some stuff
\set table_name dual
select * from :table_name;
dummy
-------
X
(1 row)
-e Example:
Code: Select all
[dbadmin@vertica01 ~]$ vsql -e -f /home/dbadmin/test.sql
select * from dual;
dummy
-------
X
(1 row)
See how the
-a option will echo every line in the sql script whereas the
-e option only echo's the SQL command?