Documentation

    bitstring

    Pads the bitstring until the specified length.

    Try an expression

    In Formula, enter the expression and set Output type to VARCHAR.

    Expression

    bitstring('1010'::BITSTRING, 7)

    Result

    '0001010'

    The expression returns BIT. Formula stores it as VARCHAR in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

    Arguments and types

    bitstring(bitstring, length)
    bitstring
    Bits, Text
    length
    Number
    Supported signatures (2)
    bitstring(bitstring: BIT, length: INTEGER) → BIT
    bitstring(bitstring: VARCHAR, length: INTEGER) → BIT

    The result type can depend on the input types. See DuckDB for the full argument rules.

    Things to know

    If the first argument is missing, the result is NULL.

    Browse bitsDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.