The function for conversion to a DECIMAL signed normalized number sets the sign for DECIMAL data to either X'C' or X'D' (for a value of 0, the sign is X'C'). Because this function lets you obtain the normalized sign without having to store DECIMAL data in a database, you can use it for the following purposes:
For details about the specification configuration, see G.1(3)(b) Specification configuration.
Before normalization | After normalization |
---|---|
X'A' | X'C' |
X'B' | X'D'* |
X'C' | X'C' |
X'D' | X'D'* |
X'E' | X'C' |
X'F' | X'C' |
X'0' to X'9' | Error |
* If the absolute value of data is 0, the sign part is set to X'C'.
int p_rdb_dec_sign_norm(unsigned char *srcp, |
Data type | Data length code |
---|---|
INTERVAL YEAR TO DAY | 8 ![]() |
INTERVAL HOUR TO SECOND | 6 ![]() |
DECIMAL[(p[,q])] | p![]() (If p is omitted, 15 is assumed; if q is omitted, 0 is assumed.) |