28 #ifndef DBA_DB_V5_CURSOR_H
29 #define DBA_DB_V5_CURSOR_H
33 #include <wreport/varinfo.h>
115 int query(
const Record&
query,
unsigned int wanted,
unsigned int modifiers);
149 virtual double get_lat()
const;
150 virtual double get_lon()
const;
151 virtual const char*
get_ident(
const char* def=0)
const;
152 virtual const char*
get_rep_memo(
const char* def=0)
const;
157 virtual wreport::Var
get_var()
const;
unsigned int wanted
What values are wanted from the query.
Definition: v5/cursor.h:58
virtual void attr_insert(const Record &attrs)
Insert/overwrite new attributes for the current variable.
DB-ALLe database connection.
Definition: v5/db.h:83
DBALLE_SQL_C_SINT_TYPE out_pind
Query results.
Definition: v5/cursor.h:80
virtual dballe::DB & get_db() const
Get the database that created this cursor.
The ODBC specification is imperfect with regards to integer sizes on 64bit platforms, and different ODBC drivers are currently interpreting it differently.
void add_station_info(Record &rec)
Query extra station info and add it to rec.
void to_record(Record &rec)
Fill in a record with the contents of a dba_db_cursor.
SQL_TIMESTAMP_STRUCT out_datetime
Query results.
Definition: v5/cursor.h:84
virtual Level get_level() const
Get the level.
unsigned int from_wanted
What is in the FROM part of the query, used to know what output fields are bound. ...
Definition: v5/cursor.h:65
DB-All.E record.
Definition: record.h:102
DBALLE_SQL_C_SINT_TYPE out_ltype1
Query results.
Definition: v5/cursor.h:76
v5::DB & db
Database to operate on.
Definition: v5/cursor.h:53
int query(const Record &query, unsigned int wanted, unsigned int modifiers)
Create and execute a database query.
DBALLE_SQL_C_SINT_TYPE out_context_id
Query results.
Definition: v5/cursor.h:88
Structure used to build and execute a query, and to iterate through the results.
Definition: v5/cursor.h:50
virtual wreport::Var get_var() const
Get the variable.
virtual int attr_reference_id() const
Return an integer value that can be used to refer to the current variable for attribute access...
Functions used to connect to DB-All.e and insert, query and delete data.
unsigned query_attrs(const AttrList &qcs, Record &attrs)
Query attributes for the current variable.
char out_ident[64]
Query results.
Definition: v5/cursor.h:75
int getcount(const Record &query, unsigned int wanted, unsigned int modifiers)
Return the number of results for a query.
virtual void get_datetime(int(&dt)[6]) const
Get the datetime.
void discard_rest()
Discard the results that have not been read yet.
virtual int get_station_id() const
Get the station identifier.
virtual void attr_remove(const AttrList &qcs)
Delete attributes for the current variable.
virtual const char * get_ident(const char *def=0) const
Get the station identifier, or NULL if missing.
char out_value[255]
Query results.
Definition: v5/cursor.h:85
bool query_station_vars
True if we are querying station variables.
Definition: v5/cursor.h:68
void reset()
Reset the cursor at the beginning of a query.
DBALLE_SQL_C_SINT_TYPE out_l2
Query results.
Definition: v5/cursor.h:79
virtual const char * get_rep_memo(const char *def=0) const
Get the report name.
DBALLE_SQL_C_SINT_TYPE out_lon
Query results.
Definition: v5/cursor.h:74
bool next()
Get a new item from the results of a query.
ODBC statement.
Definition: internals.h:220
DBALLE_SQL_C_SINT_TYPE out_ltype2
Query results.
Definition: v5/cursor.h:78
DBALLE_SQL_C_SINT_TYPE out_p2
Query results.
Definition: v5/cursor.h:82
virtual Trange get_trange() const
Get the level.
virtual double get_lon() const
Get the station longitude.
wreport::Varcode out_varcode
Query results.
Definition: v5/cursor.h:83
db::Statement * stm
ODBC statement to use for the query.
Definition: v5/cursor.h:55
virtual double get_lat() const
Get the station latitude.
int remaining() const
Get the number of rows still to be fetched.
virtual wreport::Varcode get_varcode() const
Get the variable code.
SQLLEN out_ident_ind
Query results.
Definition: v5/cursor.h:75
DBALLE_SQL_C_SINT_TYPE out_ana_id
Query results.
Definition: v5/cursor.h:87
unsigned int modifiers
Modifier flags to enable special query behaviours.
Definition: v5/cursor.h:61
DBALLE_SQL_C_SINT_TYPE out_l1
Query results.
Definition: v5/cursor.h:77
DBALLE_SQL_C_SINT_TYPE count
Number of results still to be fetched.
Definition: v5/cursor.h:93
DBALLE_SQL_C_SINT_TYPE out_rep_cod
Query results.
Definition: v5/cursor.h:86
DBALLE_SQL_C_SINT_TYPE out_priority
Query results.
Definition: v5/cursor.h:89
DBALLE_SQL_C_SINT_TYPE out_p1
Query results.
Definition: v5/cursor.h:81
DBALLE_SQL_C_SINT_TYPE out_lat
Query results.
Definition: v5/cursor.h:73