FIXEDBIN
FIXEDBIN returns a FIXED BIN value with precision and scale derived from the source unless explicitly specified as parameters to the function.
- x
- Expression.
- p
- Restricted expression that specifies the total number of digits in the result. It must not exceed the implementation limit.
- q
- Restricted expression that specifies the scaling factor of the result. If q is omitted, a scaling factor of zero is assumed. If q is specified, it must be between 0 and p.
If both p and q are omitted, the precision of the result is determined from the source according to this table:
source | result |
---|---|
FIXED BIN(p,q) | FIXED BIN(p,q) |
FIXED DEC(p,q) | FIXED BIN(r,s)
where r = min(M,1+CEIL(p*3.32)) and s = CEIL(ABS(q*3.32))*SIGN(q) |
FLOAT BIN(p) | FIXED BIN(p,0) |
FLOAT DEC(p) | FIXED BIN(r,0)
where r = min(M,CEIL(p*3.32)) |
BIT | FIXED BIN(M,0) |
CHAR, GRAPHIC, UCHAR, or WIDECHAR | FIXED BIN(r,0)
where r = min(M,1+CEIL(N*3.32)) |