classname_fieldname_first

Reads the first logical element of a persistent sequence field.

Prototype

    MCO_RET classname_fieldname_first(
        classname *handle,
        field_type *value);

Arguments

handle is a valid object handle scoped to an active read-only or read-write transaction. value receives the first element.

Return codes

Other database and transaction errors can be propagated by the generated function.

Example

    mco_int4 value;
    MCO_RET rc;

    rc = Sensor_readings_first(&sensor, &value);
    if (rc == MCO_S_OK) {
        /* use value */
    }

Use classname_fieldname_iterator() with a nullable typed getter when NULL elements must be distinguished and retained.