Possible name conflictYES →

    Result typeSMALLINT, INTEGER or BIGINT

    Note

    SMALLINT result is returned only if all the arguments are explicit SMALLINTs or NUMERIC(*n*, 0) with n <= 4; otherwise small integers return an INTEGER result.

    Syntax

    Table 8.6.1.1 BIN_AND Function Parameters

    Returns the result of the bitwise AND operation on the argument(s).

    See alsoSection 8.6.3, BIN_OR(),

    8.6.2 BIN_NOT()

    Available inDSQL, PSQL

    Result typeSMALLINT, INTEGER or

    Note

    SMALLINT result is returned only if all the arguments are explicit SMALLINTs or NUMERIC(*n*, 0) with n <= 4; otherwise small integers return an INTEGER result.

    Syntax

    1. BIN_NOT (number)

    Table 8.6.2.1 BIN_NOT Function Parameter

    ParameterDescription

    number

    Any integer number (literal, smallint/integer/bigint, numeric/decimal with scale 0)

    Returns the result of the bitwise NOT operation on the argument, i.e. one’s complement.

    See also, Section 8.6.6, BIN_XOR() and others in this set.

    Possible name conflictYES →

    Result typeSMALLINT, INTEGER or BIGINT

    Note

    SMALLINT result is returned only if all the arguments are explicit SMALLINTs or NUMERIC(*n*, 0) with n <= 4; otherwise small integers return an INTEGER result.

    Syntax

    Table 8.6.3.1 BIN_OR Function Parameters

    Returns the result of the bitwise OR operation on the argument(s).

    See alsoSection 8.6.1, BIN_AND(),

    8.6.4 BIN_SHL()

    Available inDSQL, PSQL

    Result typeBIGINT

    Syntax

    Table 8.6.4.1 BIN_SHL Function Parameters

    ParameterDescription

    number

    A number of an integer type

    shift

    The number of bits the number value is shifted by

    Returns the first argument bitwise left-shifted by the second argument, i.e. a << b or a·2b.

    See also

    Result typeBIGINT

    Syntax

    Table 8.6.5.1 BIN_SHR Function Parameters

    Returns the first argument bitwise right-shifted by the second argument, i.e. a >> b or a/2b.

    See alsoSection 8.6.4, BIN_SHL()

    8.6.6 BIN_XOR()

    Available inDSQL, PSQL

    Possible name conflictYES → Read details

    Result typeSMALLINT, INTEGER or BIGINT

    Note

    SMALLINT result is returned only if all the arguments are explicit SMALLINTs or NUMERIC(*n*, 0) with n <= 4; otherwise small integers return an INTEGER result.

    Syntax

    1. BIN_XOR (number, number [, number ...])

    Table 8.6.6.1 Function Parameters

    ParameterDescription

    number

    Any integer number (literal, smallint/integer/bigint, numeric/decimal with scale 0)

    Returns the result of the bitwise XOR operation on the argument(s).

    See also, Section 8.6.3, BIN_OR()