nzsql

How do I use session variables in Netezza nzsql?

删除回忆录丶 提交于 2020-01-14 06:07:43
问题 How do I create and use session variables in Netezza nzsql ? How can I use session variables as part of strings? Can I concatenate session variables with strings? Can I embed session variables in strings? How can I use them as part of table names or column names? 回答1: Basic Variable Usage The documentation for session variables in Netezza nzsql is somewhat lacking. It states that in order to set a variable within a script or at the nzsql prompt, you use \set . \set var value You can also

How to output a file using tab delimiter in Netezza NZSQL

亡梦爱人 提交于 2019-12-12 11:18:51
问题 I am trying to output some files using NZSQL CLI but not able to output as tab delimited files. Can somebody who has worked on NZ share your thoughts on this below command. Tried so far :- nzsql -o sample.txt -F= -A -t -c "SELECT * FROM DW_ETL.USER WHERE datasliceid % 20 = 2 LIMIT 5;" 回答1: To specify tab as the delimiter use $ in conjunction with the -F option. nzsql -o sample.txt -F $'\t' -A -t -c "SELECT * FROM DW_ETL.USER WHERE datasliceid % 20 = 2 LIMIT 5;" This is documented in the nzsql