/** * show_results - Show a result set from the server via Serial.print * * This method reads a result from the server and displays it via the * via the Serial.print methods. It can be used in cases where * you may want to issue a SELECT or SHOW and see the results on your * computer from the Arduino. * * It is also a good example of how to read a result set from the * because it uses the public methods designed to return result * sets from the server. */ void Connector::show_results() { column_names *cols; int rows = 0; // Get the columns cols = get_columns(); if (cols == NULL) { return; } for (int f = 0; f < columns.num_fields; f++) { Serial.print(columns.fields[f]->name); if (f < columns.num_fields-1) Serial.print(','); } Serial.println(); // Read the rows while (get_next_row()) { rows++; for (int f = 0; f < columns.num_fields; f++) { Serial.print(row.values[f]); if (f < columns.num_fields-1) Serial.print(','); } free_row_buffer(); Serial.println(); } // Report how many rows were read Serial.print(rows); Serial.println(" rows in result."); free_columns_buffer(); }
void worksheet::append(const std::unordered_map<int, std::string> &cells) { auto row = get_next_row(); for (auto cell : cells) { get_cell(cell_reference(static_cast<column_t>(cell.first), row)).set_value(cell.second); } }
void worksheet::append(const std::unordered_map<std::string, std::string> &cells) { auto row = get_next_row(); for (auto cell : cells) { get_cell(cell_reference(cell.first, row)).set_value(cell.second); } }
void worksheet::append(const std::vector<int>::const_iterator begin, const std::vector<int>::const_iterator end) { xlnt::cell_reference next(1, get_next_row()); for (auto i = begin; i != end; i++) { get_cell(next).set_value(*i); next.set_column_index(next.get_column_index() + 1); } }
void worksheet::append(const std::vector<cell> &cells) { xlnt::cell_reference next(1, get_next_row()); for (auto cell : cells) { get_cell(next).set_value(cell); next.set_column_index(next.get_column_index() + 1); } }
Datum plexor_call_handler(PG_FUNCTION_ARGS) { if (CALLED_AS_TRIGGER(fcinfo)) elog(ERROR, "plexor function can't be used as triggers"); if (fcinfo->flinfo->fn_retset) { if (SRF_IS_FIRSTCALL()) execute(fcinfo); return get_next_row(fcinfo); } else { execute(fcinfo); return get_single_result(fcinfo); } }
/** * raytraces an object in parallel and stores or compares it to source */ void rt_worker(int UNUSED(cpu), void *g) { struct application ap; struct fitness_state *fstate = (struct fitness_state *)g; int u, v; RT_APPLICATION_INIT(&ap); ap.a_rt_i = fstate->rtip; if (fstate->capture) { ap.a_hit = capture_hit; ap.a_miss = capture_miss; } else { ap.a_hit = compare_hit; ap.a_miss = compare_miss; } ap.a_resource = &rt_uniresource;/*fstate->resource[cpu];*/ ap.a_ray.r_dir[X] = ap.a_ray.r_dir[Y] = 0.0; ap.a_ray.r_dir[Z] = 1.0; ap.a_uptr = (void *) g; u = -1; while ((v = get_next_row(fstate))) { for (u = 1; u <= fstate->res[X]; u++) { ap.a_ray.r_pt[X] = fstate->min[X] + u * fstate->gridSpacing[X]; ap.a_ray.r_pt[Y] = fstate->min[Y] + v * fstate->gridSpacing[Y]; ap.a_ray.r_pt[Z] = fstate->min[Z]; ap.a_user = (v-1)*(fstate->res[X]) + u-1; rt_shootray(&ap); } } }
/* show_results - Show a result set from the server via Serial.print This method reads a result from the server and displays it via the via the Serial.print methods. It can be used in cases where you may want to issue a SELECT or SHOW and see the results on your computer from the Arduino. It is also a good example of how to read a result set from the because it uses the public methods designed to return result sets from the server. */ void MySQL_Cursor::show_results() { column_names *cols; int rows = 0; // Get the columns cols = get_columns(); if (cols == NULL) { return; } for (int f = 0; f < columns.num_fields; f++) { Serial.print(columns.fields[f]->name); if (f < columns.num_fields-1) Serial.print(','); } Serial.println(); // Read the rows while (get_next_row()) { rows++; for (int f = 0; f < columns.num_fields; f++) { Serial.print(row.values[f]); if (f < columns.num_fields-1) Serial.print(','); } free_row_buffer(); Serial.println(); } // Report how many rows were read Serial.print(rows); conn->show_error(ROWS, true); free_columns_buffer(); // Free any post-query messages in queue for stored procedures clear_ok_packet(); }
void worksheet::append() { get_cell(cell_reference(1, get_next_row())); }