0% found this document useful (0 votes)
150 views

Netezza SQL

This document provides information on using environmental variables, sessions, executing queries from files, reading input, storing count values in variables, and outputting to files when using the nzsql command line tool to interact with a Netezza database. Key steps include setting NZ_USER, NZ_PASSWORD and NZ_DATABASE environmental variables, using ALTER, DROP and SHOW commands to manage sessions, executing queries from files using -f or \i, reading input using <, storing result counts in variables like VAR1, and outputting query results to files with -o or \o.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views

Netezza SQL

This document provides information on using environmental variables, sessions, executing queries from files, reading input, storing count values in variables, and outputting to files when using the nzsql command line tool to interact with a Netezza database. Key steps include setting NZ_USER, NZ_PASSWORD and NZ_DATABASE environmental variables, using ALTER, DROP and SHOW commands to manage sessions, executing queries from files using -f or \i, reading input using <, storing result counts in variables like VAR1, and outputting query results to files with -o or \o.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Netezza:-Environmental variables ----------------------NZ_USER="xxx" NZ_PASSWORD="*****" NZ_DATABASE="TRAINING_DB" NZ_SECURITY_LEVEL : preferredSecured, preferredUnsecured, onlySecured, onlyUnsec ured SESSIONS --------ALTER, DROP, SHOW

\set->displays session variables TO EXECUTE QUERIES FROM A FILE ------------------------------1. nzsql -f filename 2. nzsql \i foo.sql TO READ INPUT ------------nzsql < foo.sql(eg.) TO STORE THE COUNT VALUE IN A VARIABLE -------------------------------------VAR1= nzsql -A -t -c "select count(*) from test_table" OUTPUT TO A FILE ---------------1. nzsql -o foo.out 2.nzsql \o foo.out

You might also like