id_spreadsheet = par_id;
__CREATE_QUERY("
SELECT co_sys_expression_range_fillV(%d,%d,%d,%d);
", id_spreadsheet, id_column, id_row, id_last_row)
__SQL_GET_RESULT
__CLEAR_RESULT
// TODO: send actions
__SQL_GET_INTEGER(num_first_row,
"SELECT row_number FROM co_sys_spreadsheet_row WHERE id=%d",
id_row )
__ASSERT(num_first_row>0, "row with id=%d not found", id_row)
__SQL_GET_INTEGER(num_last_row,
"SELECT row_number FROM co_sys_spreadsheet_row WHERE id=%d",
id_last_row )
__ASSERT(num_last_row>0, "row with id=%d not found", id_last_row)
__CREATE_QUERY("
SELECT
id_row, index_ref,
id_ref_column, id_ref_row, is_ref_column_hard, is_ref_row_hard,
id_ref_column2, id_ref_row2, is_ref_column2_hard, is_ref_row2_hard,
function
FROM co_sys_expression_range AS RANGE, co_sys_spreadsheet_row AS ROW
WHERE RANGE.id_spreadsheet=%d AND RANGE.id_column=%d AND
RANGE.id_row = ROW.id AND ROW.row_number>%d AND ROW.row_number<=%d
", id_spreadsheet, id_column,
num_first_row, num_last_row)
__SQL_GET_RESULT
ntuples = cor_GetTupleCount(cnx, corec);
{
const char* class_names[] = {"spreadsheet","spreadsheet_column","spreadsheet_row",NULL};
int object_ids[] = {id_spreadsheet,id_column,id_row};
int id_row_current;
char prop_name[32]; /* 2*id(10dig) + 1*index+2*'_' */
char prop_value[32]; /* 2*id + 2*bool+3*',' */
for (i=0; i<ntuples; i++) {
id_row_current = atoi(cor_GetValue(cnx, corec, i, 0));
object_ids[2] = id_row_current;
snprintf(prop_name, 32, "p%d_%d_%s", id_column, id_row_current,
cor_GetValue(cnx, corec, i, 1));
snprintf(prop_value, 32, "%s,%s,%s,%s,%s,%s,%s,%s,%s",
cor_GetValue(cnx, corec, i, 2),cor_GetValue(cnx, corec, i, 3),cor_GetValue(cnx, corec, i, 4),
cor_GetValue(cnx, corec, i, 5),cor_GetValue(cnx, corec, i, 6),cor_GetValue(cnx, corec, i, 7),
cor_GetValue(cnx, corec, i, 8),cor_GetValue(cnx, corec, i, 9),cor_GetValue(cnx, corec, i, 10));
cou_queueActionX( cnx, "expression_range", class_names, object_ids,CO_OP_UPDATE, prop_name, prop_value, NULL );
}
}
__CLEAR_RESULT