classname_fieldname_insert

Inserts a contiguous array of non-null elements before a logical position in a persistent sequence field.

Prototype

    MCO_RET classname_fieldname_insert(
        classname *handle,
        mco_seq_no_t position,
        field_type const *values,
        mco_size_t n_items);

Position

position is zero-based. Existing elements at and after the position shift right by n_items. A position equal to the current count appends the values. A position greater than the current count returns MCO_E_ILLEGAL_PARAM.

Ordered fields

The inserted values and both neighboring boundaries must preserve the field's declared ascending or descending order. A violation returns MCO_E_SEQ_OUT_OF_ORDER.

Common return codes

Example

    mco_int4 value = 25;
    MCO_RET rc;

    rc = Sensor_readings_insert(&sensor, 2, &value, 1);

Use classname_fieldname_insert_nullable() to insert NULL elements.