Size-specific arguments

With size-specific UDXs such as the customerName example, you must declare the type and size of all input arguments and the return value. Specific data type size declarations are useful for resource planning and for error-checking of the input arguments and return values. However, they can be somewhat limiting if your UDXs process strings or numerics that can vary in size each time you run a query.

Constant data type sizes often require you to use larger data type sizes (and thus more storage resources) to support the maximum input values, return values, or both. They can also result in implicit casts, such as casting a smaller input value to fit the larger declared size. For example, it can increase the precision of a numeric or add padding to strings. If you choose too small a size, you risk loss of precision if the Netezza Performance Server system casts a larger input numeric to the smaller numeric or truncates input strings that exceed the defined string input size.