FirebirdSQL logo

SET DECFLOAT ROUND

SET DECFLOAT ROUND changes the rounding behaviour of operations on DECFLOAT.The default rounding mode is HALF_UP.The initial configuration of a connection can also be specified using the DPB tag isc_dpb_decfloat_round with the desired round_mode as string value.

The valid rounding modes are:

CEILING

towards +infinity

UP

away from 0

HALF_UP

to nearest, if equidistant, then up (default)

HALF_EVEN

to nearest, if equidistant, ensure last digit in the result will be even

HALF_DOWN

to nearest, if equidistant, then down

DOWN

towards 0

FLOOR

towards -infinity

REROUND

up if digit to be rounded is 0 or 5, down in other cases

The current value for the connection can be found using RDB$GET_CONTEXT('SYSTEM', 'DECFLOAT_ROUND').

Execution of [fblangref50-management-session-reset-alter] will revert to the value configured through the DPB, or otherwise the system default.

SET DECFLOAT TRAPS

SET DECFLOAT TRAPS changes the error behaviour of operations on DECFLOAT.The default traps are DIVISION_BY_ZERO,INVALID_OPERATION,OVERFLOW;this default matches the behaviour specified in the SQL standard for DECFLOAT.This statement controls whether certain exceptional conditions result in an error (“trap”) or alternative handling (for example, an underflow returns 0 when not set, or an overflow returns an infinity).The initial configuration of a connection can also be specified using the DPB tag isc_dpb_decfloat_traps with the desired comma-separated trap_opt values as a string value.

Valid trap options (exceptional conditions) are:

Division_by_zero

(set by default)

Inexact

 — 

Invalid_operation

(set by default)

Overflow

(set by default)

Underflow

 — 

The current value for the connection can be found using RDB$GET_CONTEXT('SYSTEM', 'DECFLOAT_TRAPS').

Execution of [fblangref50-management-session-reset-alter] will revert to the value configured through the DPB, or otherwise the system default.