Command inputs

Using the nzsql command, you can specify different input options:
  • To run a single query from the command line, enter:
       nzsql -c "SELECT * FROM test_table"
  • On the NPS system or UNIX clients, to read input from the current source, for example a script, enter:
    nzsql <<eof
    SELECT * FROM test_table;
    eof
  • To read input (standard in), enter:
    nzsql < foo.sql
  • To run queries from a file (command-line argument), enter:
    nzsql -f foo.sql
  • To run queries from a file (nzsql option), enter:
       NZSQL
    \i foo.sql