\i FILE
\i filename
command reads input from the file filename and executes it as though it had been typed on the keyboard.
Note: To see the lines on the screen as they are read, set the variable ECHO to all.
Tip: The Vertica vsql client on Linux supports backquote (backtick) expansion. A simple example follows.
-
Set an environment variable to a path that contains scripts you want to run.
$ export MYSCRIPTS=/home/dbadmin/testscripts
-
Issue the vsql command.
$ vsql
-
Use backquote expansion to include the path for running an existing script (for example, sample.sql).
=> \i `echo $MYSCRIPTS/sample.sql`