how to execute unix commands within nzsql? I'm converting a script from Teradata to Netezza, and I'm stuck at the portion where BTEQ uses the functionality of the OS to check if a file contains any data. If it does, it is deleted. I want to perform the same function in nzsql.

Can anyone please help?
The documentation for nzsql states that to shell-out you just have to use blackslash pling, followed by the command:

\! command


If you need to know how to test for file size in a shell script, you can use something similar to:

if [[ -f $file ]] &amp;&amp; [[ -s $file ]]; then 
  echo "File exists and is greater than 0 bytes" ; 
  rm -f $file
fi


-f checks that it exists, -s checks if it's greater than 0 bytes.