The nzLua command-line program

The nzLua distribution comes with a CLI version of nzLua. You can use it for developing and code testing outside of the database. The nzlua command-line program is located in the /nz/extensions/nz/nzlua/bin directory. All of the functions that are available inside of Netezza that use nzLua can be also used from the CLI version of nzlua.

nzlua - <<-END
print("Hello world!")
for i=1,10 do
print( "i = " || i )
end

END
In the example, the nzlua command-line program was launched by using the - argument (nzlua - <<-END). When passing a script to the nzlua command-line program that uses a HERE document in a shell script, the - option must be used so that nzlua aborts and returns an error code back to the shell script if an error occurs. If the - option is not used, nzlua operates in interactive mode and will not exit when an error occurs.