Following are some examples of the results that may be expected when using SELECT_SQL when the column field type and the LANSA field type are not the same - thus coercion needs to occur.
Test Values were all numeric. If an Alpha/String contains non-numeric data, the coercion to numerics is undefined. It may result in 0, it may ignore non-numeric characters and convert the rest, and it may ABEND.
Note that overflow of a value is undefined. For example, if a number is too large to fit in to a field, it may truncate left or right or indeed be an indeterminate value. On IBM i, it is usually a fatal error.
Where NO is stated, a coercion is performed, but valid coercions are not common due to formatting requirements.
|
Coercion: Best attempt to take a value of one type and make some sense of it in another type. For example, packed 1234 becomes Alpha "1234" when viewed on a Form. In this case the underlying packed data has been converted to a string and then assigned to the Alpha field. This is in contrast to a LANSA OVERLAY, where no conversion is performed and the alpha would contain the same binary data as the Packed field, that is, the Alpha would NOT display the number when viewed on a Form. Any reliance on coercions must be thoroughly tested for the entire range of expected source values on all databases that the application will run on.
RDML Field types in an RDML Function are all interchangeably coercible. The only platform difference is that an overflow or underflow on Visual LANSA platforms sets the field value to 0. On IBM i, an ABEND occurs. For example, Assigning 123 to a Packed(7,7).