insert nullable
此函数将提供的值(包括空值)插入到序列中。
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
);
参数
handle
classname
指向类名句柄的指针。
pos
mco_seq_no_t
要插入值的位置编号(从零开始)
values
TYPE
指向序列中第一个值的指针。
n_items
mco_size_t
要从值中添加到序列中的元素数目。
nulls
mco_bitmap_word_t const *
一个 mco_bitmap_word_t
类型的数组(定义为 8 字节的无符号整数),其中每个设置的位都标记序列中的一个空元素。位的位置对应于序列中空元素的位置。鉴于 mco_bitmap_word_t
为 8 字节(64 位),空元素数组必须至少包含 ((n_items + 63) / 64) 个元素。
返回
MCO_S_OK
值已成功设置。
MCO_E_ACCESS
该类处理的事务范围是 MCO_READ_ONLY
。
示例
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("e, 0, open_buf, BUF_SIZE, null_bitmap);