classname_fieldname_append

Appends a contiguous array of non-null elements to a persistent sequence field.

Prototype

    MCO_RET classname_fieldname_append(
        classname *handle,
        field_type const *values,
        mco_size_t n_items
    );

Arguments

handle is scoped to an active read-write transaction. values points to n_items contiguous elements of the generated field type. For char<N>, the buffer contains n_items * N bytes.

Ordered fields

For an ascending or descending sequence field, the input array must be ordered in the declared direction and its first value must preserve order relative to the current last element. Otherwise the function returns MCO_E_SEQ_OUT_OF_ORDER.

Return codes

Allocation and transaction errors can also be propagated. The operation participates in the surrounding transaction and is undone by rollback.

Example

    mco_int4 values[3] = { 10, 20, 30 };
    MCO_RET rc;

    rc = Sensor_readings_append(&sensor, values, 3);

Use classname_fieldname_append_nullable() to append NULL elements.