-a vs -e option of vsql

Moderator: NorbertKrupa

Post Reply
debfawn
Beginner
Beginner
Posts: 47
Joined: Tue Jan 29, 2013 2:30 pm

-a vs -e option of vsql

Post by debfawn » Thu Jan 29, 2015 2:12 pm

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!

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: -a vs -e option of vsql

Post by JimKnicely » Thu Jan 29, 2015 2:26 pm

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?
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “vSQL”