finalize()
The finalize method is called after all rows have been processed by the UDX.
The finalize method can be used to store data in the SPUPad or utilize some other feature that operates outside of the normal data flow of the SQL statement. The finalize method does not accept any arguments or return any values.
Any errors generated during the finalize method call are trapped and ignored, therefore the finalize method should only be used to execute statements that are certain to not fail or in cases where failure of the functions being called is not fatal.
function finalize()
saveTable("mytable", myresults)
end