classname_fieldname_insert_nullable

This function inserts the supplied values, including nulls, into the sequence.

Prototype

 
    MCO_RET	classname_fieldname_insert_nullable(	/*IN*/ classname *handle, 
                            /*IN*/ mco_seq_no_t pos,
                            /*IN*/ TYPE *values, 
                            /*IN*/ mco_size_t n_items,
                            /*IN*/ mco_bitmap_word_t const * nulls );
 

Arguments

handle A pointer to a classname handle
pos The position number (zero-based) where values are to be inserted

values

A pointer to the values to be inserted into the sequence

n_items

The number of elements to be inserted from values to the sequence

nulls An array of mco_bitmap_word_t (defined as an 8-byte unsigned integer), where each set bit marks a null element in the sequence. The position of the bit corresponds to the position of the null element in the sequence. Given that mco_bitmap_word_t is 8 bytes (64 bits), the nulls array must contain at least ((n_items + 63) / 64) elements

Description

This function applies to sequence fields. The supplied values are inserted into the sequence at position pos.

Return Codes

MCO_S_OK The value was put successfully
MCO_E_ACCESS The transaction that the class handle is scoped to is MCO_READ_ONLY

Example

 
    Quote quote;
    float open_buf[BUF_SIZE];
    mco_bitmap_word_t null_bitmap[(BUF_SIZE + 63) / 64];
     
    /* Reset NULL bitmap */
    memset(null_bitmap, 0x00, sizeof(null_bitmap));
     
    /* Locate the quote object and initialize the "quote" handle... */
     
    /* Fill the open_buf with BUF_SIZE values... */
    /* ... */
     
    /* Mark the first element as null by setting the first bit */
    null_bitmap[0] |= 0x01;
     
    /* Mark the third element as null by setting the third bit */
    null_bitmap[0] |= 0x04;
     
    /* Insert the "open_buf" array's contents into the "open" sequence
    of the quote at position 0, and set the NULL bitmap */
    Quote_open_insert_nullable(&quote, 0, open_buf, BUF_SIZE, null_bitmap);