calculateSize()
When the return type of a UDSF is VARCHAR(ANY), the calculateSize() method is called at runtime to dynamically determine the size of the result column.
The single argument of the calculateSize() method is a Lua table that contains one record for each argument. Each record contains the following fields:
Field | Description |
---|---|
args.count | The number of arguments with which the UDSF was invoked. |
args[i].type | The argument type (see Argument types). |
args[i].length | The length of a CHAR or VARCHAR argument. |
Example
function calculateSize( args )
return args[1].length + args[2].length
end
function getResult()
return varchar(any)
end