The following rules apply if values are made available for placeholders in host variables or in a descriptor area (EXECUTE...USING, OPEN...USING):
The data type of the input value must be compatible with the data type of the placeholder, which is indicated by the position of the placeholder (see "Rules for placeholders").
Values for atomic placeholders and multiple placeholders with the dimension 1 can be made available via an atomic host variable, a vector with one element, or via an item descriptor.
Placeholders for aggregates with a dimension d > 1 can be made available via a vector with d elements or via d sequential item descriptors.
Additional data-type-specific rules, which depend on the data type involved, also apply. These are described below.
Strings
You can use the value of a host variable or item descriptor with an alphanumeric data type for an alphanumeric placeholder. For a placeholder with a national data type you can use the value from a user variable or a descriptor area entry with a national data type. The following rules apply:
If the target data type is CHAR or NCHAR and the length of the value is smaller than the length of the target data type, the value is padded on the right with blanks.
If the target data type is CHAR or NCHAR and the length of the value is greater than the length of the target data type, the value is truncated from the right to the length of the target data type. If characters are removed that are not blanks, the value is not entered and a warning is issued.
If the target data type is VARCHAR or NVARCHAR and the length of the value is greater than the maximum length of the target data type, the value is truncated from the right to the maximum length of the target data type. If characters are removed that are not blanks, the value is not entered and a warning is issued.
Numeric values
You can use a value from a host variable or an item descriptor with a numeric data type for a numeric placeholder. If the numeric data types are not the same, the value is converted to the target data type. The following rules apply:
If the number of digits to the right of the decimal point of the value is too large for the target data type, the value is rounded.
If the value is too large for the target data type, the value is not entered and an error message is issued.
Time values
In the case of a placeholder with a date or time data type, you can only use a value from a host variable or item descriptor of the same data type:
a date for a DATE placeholder
a time for a TIME placeholder
a time stamp for a TIMESTAMP placeholder