Compiling and installing programs
Learn how to compile and install an nzLua script.
About this task
The /nz/extensions/nz/nzlua/examples directory has many sample nzLua programs that you can use as learning aids. You can also use them to verify that nzLua was installed correctly. Many of the examples are well commented and serve as an excellent way to learn how to develop UDX programs in the Netezza database using nzLua.
Here is an example of compiling the nzlua_version.nzl
script and then using the
nzlua_version()
UDF it creates. The installation directory always includes the
version number of nzLua that was installed. In this case the directory shown is for nzLua 2.0.0.
Procedure
cd /nz/extensions/nz/nzlua/examples
nzl nzlua_version.nzl
nzsql -c "select nzlua_version()"
Output
example of installing the nzlua_version.nzl
program:Compiling: nzlua_version.nzl
####################################################################
UdxName = nzlua_version
UdxType = UDF
Arguments = VARCHAR(10)
Dependencies = INZA..LIBNZLUA_2_0_0
NZUDXCOMPILE OPTIONS: (--unfenced --mem 2m )
CREATE FUNCTION
Created udf
Done
Output
example of executing the
command:nzsql -c "select nzlua_version()"
NZLUA_VERSION
---------------
2.0.0
(1 row)
The
version number in the output needs to match the version of nzLua that was installed.