char
DDL info: CHAR(n)
C++ info: UdxBase::UDX_FIXED
Note: You
can specify CHAR(ANY) as an input type when creating a UDX. The function then
accepts a character string of any length up to 254 characters. The
length of the parameter is determined by the length of the corresponding
input argument. No truncation or blank padding is done for the input
argument. If an argument is implicitly cast from a non-character string,
the length is determined by following the same rules that the CHAR
SQL function uses to determine the length attribute of the result.
struct StringArg
{
char* data;
int length; // Bytes used by string data (not characters).
int dec_length; // Character declared length.
};
struct StringReturn
{
char* data;
int size;
// On enter it is the size (in bytes) allocated for string data.
// On return it is the size (in bytes) actually used.
};
The char type often has implicit spaces at the end when passed as an argument. The difference between the specified length and the dec_length indicates how many trailing spaces must be accounted for. Length is in bytes and dec_length is in characters.