Component sql_query
Component index
Section index

Component sql_query


Search

Type

Function

Summary

Perform an SQL query and reports each rows

Description

void doend ()
void dostart (int nbrow)
void empty ()
void onerow (const char *row[], int rownum, NSQL_FIELD_NAMES &fields)

Examples

sample / sql_query and sqlgen_interface
sample / sql_query component

Prototypes

int sql_query (NSQL &sq, const char *ctl, ...)

Return the number of records found or -1 if any errors

int sql_query (const char *ctl, ...)

Return the number of records found. Return -1 if any errors. Used the default connection set by query_setdefaultdb().

Functags

void doend () Optional

Called after the last onerow() has been called

Called only if there was some records found, like dostart()

void dostart (int nbrow) Optional

Called before calling the first onerow

There is at least one record found

void empty () Optional

Called if the query did not found any record

void onerow (const char *row[], int rownum, NSQL_FIELD_NAMES &fields) Mandatory

Is called for every records found