We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Have VSQL Beep Upon Command Completion — Vertica Forum

Have VSQL Beep Upon Command Completion

Jim_KnicelyJim_Knicely - Select Field - Administrator

There are a lot of cool command line options available to VSQL. One of my favorites is the –b option which causes Vertica to “beep” when a command completes. This is very useful if you are running a very long sequence of SQL commands via a script. You can go off and do other things while the script runs. VSQL will “beep” once letting you know latter that the script has completed!

Example:

[dbadmin@SE-Sandbox-26-node1 ~]$ cat beep.sql
SELECT version();
SELECT sysdate;
SELECT user;
SELECT 'SOME_DATA';
SELECT 'SOME MORE DATA';
-- Alot more stuff...
SELECT sysdate;

[dbadmin@SE-Sandbox-26-node1 ~]$ vsql -bf beep.sql -o beep.log

<< I heard a “Beep” >>

[dbadmin@SE-Sandbox-26-node1 ~]$ cat beep.log
              version
------------------------------------
Vertica Analytic Database v9.2.1-5
(1 row)

          sysdate
----------------------------
2019-09-03 15:54:41.510405
(1 row)

current_user
--------------
dbadmin
(1 row)

?column?
-----------
SOME_DATA
(1 row)

   ?column?
----------------
SOME MORE DATA
(1 row)

          sysdate
---------------------------
2019-09-03 15:54:41.53582
(1 row)

Helpful Link:
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/ConnectingToVertica/vsql/CommandLineOptions.htm

Have fun!

Comments

Sign In or Register to comment.