classname_fieldname_insert_nullable

Inserts elements and their element-level NULL states before a logical position in a persistent sequence field.

Prototype

    MCO_RET classname_fieldname_insert_nullable(
        classname *handle,
        mco_seq_no_t position,
        field_type const *values,
        mco_size_t n_items,
        mco_bitmap_word_t const *null_bitmap);

Behavior

position is zero-based and may be equal to the current count. Bit i of null_bitmap describes values[i]; a set bit marks that inserted element as NULL. The bitmap contains at least (n_items + 63) / 64 words. A NULL bitmap pointer means that no inserted elements are NULL.

Existing values and their NULL bits at and after position shift together, preserving alignment.

Common return codes

Example

    mco_int4 values[2] = { 25, 0 };
    mco_bitmap_word_t nulls[1] = { 2 };
    MCO_RET rc;

    rc = Sensor_readings_insert_nullable(&sensor, 2, values, 2, nulls);