\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.

  1. Set an environment variable to a path that contains scripts you want to run.

    $ export MYSCRIPTS=/home/dbadmin/testscripts

  2. Issue the vsql command.

    $ vsql

  3. Use backquote expansion to include the path for running an existing script (for example, sample.sql).

    => \i `echo $MYSCRIPTS/sample.sql`