StringBuffer module
The StringBuffer module allows a string to be built up by appending to the end of the
StringBuffer. Just as in Java, C#, and other garbage collected languages, strings are immutable
objects in Lua. The StringBuffer module is supposed to be used for building large strings by
appending to the end of the StringBuffer instead of using string concatenation. Once the string is
built by using the StringBuffer, it can be converted into a normal Lua string by using the
toString
method of the StringBuffer object or using the standard Lua
tostring
function.
A StringBuffer can be used in place of a Lua string to return results back to the Netezza
database. Returning a StringBuffer as a function result is more efficient than converting the
StringBuffer into a string using tostring()
or the :toString()
method and then returning the resulting string.