QueryResult:records()

Return a Cursor over the result set DataSource.

For an overview see page QueryResult

Prototype

 
    Cursor* records( void );
 

Arguments

void No arguments

Description

Return a Cursor over the result set DataSource.

Returns

An iterator over the vector of Fields or throws a RuntimeException in the case of an error.

Example

 
    void show_results( char * sql )
    {
        QueryResult result(engine.executeQuery(sql));
        Cursor* cursor = result->records();
            
        while (cursor->hasNext())
        {
            Record* rec = cursor->next();
            _Person p;
            // Extract the Person record to the corresponding struct
            result->extract(rec, &p, sizeof(p));
            printf("\t\t%d) Name=%s, Ordinal=%u\n", count, p.name, p.ordinal );
        }
    }