Signatures

For a UDX or SQL function, its name and the list of its input arguments comprise its signature. For example, udx42(VARCHAR,CHAR) is the signature of a UDX with the name udx42 that accepts two input arguments (one VARCHAR and one CHAR).

A signature must be unique within a schema. Different data type sizes do not result in different signatures. For example, both of the following definitions would result in identical signatures:
udx200(VARCHAR(124),CHAR(14))
udx200(VARCHAR(600),CHAR(72))
If there are common use-cases where a function must accept different-sized input, either:
  • Design one UDX to accept the largest of the possible values. (This was done in the customername example in the previous section.)
  • Register several UDXs.

For maximum flexibility, you can specify VARARGS in place of the list of its input arguments. However, if you do this there can be no other UDX with the specified name in the same schema or in any of the schemas in the same function path. For example, if there are two functions with the signatures udx5(int) and udx5(VARARGS), the former will always be used (even when the data type conversion would fail) and the latter will always be ignored.