classname_fieldname_store

Consumes the remaining elements of an iterator and appends them to a persistent sequence field.

Prototype

    MCO_RET classname_fieldname_store(
        classname *handle,
        mco_seq_iterator_h source);

Behavior

This function is eager: it repeatedly advances source and appends each returned tile before it returns. It does not clear or replace existing field contents. If the source iterator was partially consumed, only its remaining elements are stored.

source must yield the same element type and fixed character width as the destination field. Element NULL states are copied. For an ordered destination, the remaining source values must preserve the declared order both internally and relative to existing field contents.

Common return codes

If an error occurs after some tiles were appended, use transaction rollback when all-or-nothing behavior is required.

Example

    mco_seq_iterator_t source;
    MCO_RET rc;

    rc = Sensor_readings_subseq(&sensor, &source, 10, 14);
    if (rc == MCO_S_OK) {
        rc = Archive_readings_store(&archive, &source);
    }