28 #ifndef DBA_DB_V6_CURSOR_H
29 #define DBA_DB_V6_CURSOR_H
33 #include <wreport/varinfo.h>
52 typedef std::vector<wreport::Varcode> AttrList;
63 DBALLE_SQL_C_SINT_TYPE out_lat;
64 DBALLE_SQL_C_SINT_TYPE out_lon;
65 char out_ident[64]; SQLLEN out_ident_ind;
66 wreport::Varcode out_varcode;
67 SQL_TIMESTAMP_STRUCT out_datetime;
69 DBALLE_SQL_C_SINT_TYPE out_rep_cod;
70 DBALLE_SQL_C_SINT_TYPE out_ana_id;
71 DBALLE_SQL_C_SINT_TYPE out_id_ltr;
72 DBALLE_SQL_C_SINT_TYPE out_id_data;
119 virtual bool next() = 0;
132 virtual double get_lat()
const;
133 virtual double get_lon()
const;
134 virtual const char*
get_ident(
const char* def=0)
const;
135 virtual const char*
get_rep_memo(
const char* def=0)
const;
140 virtual wreport::Var
get_var()
const;
162 void to_record_pseudoana(
Record& rec);
163 void to_record_repinfo(
Record& rec);
164 void to_record_ltr(
Record& rec);
165 void to_record_datetime(
Record& rec);
166 void to_record_varcode(
Record& rec);
247 SQL_TIMESTAMP_STRUCT out_datetime_max;
virtual dballe::DB & get_db() const
Get the database that created this cursor.
virtual void query(const Record &rec)
Query station info.
void add_station_info(Record &rec)
Query extra station info and add it to rec.
virtual void to_record(Record &rec)
Fill in a record with the contents of a dba_db_cursor.
virtual int attr_reference_id() const
Return an integer value that can be used to refer to the current variable for attribute access...
virtual void get_datetime(int(&dt)[6]) const
Get the datetime.
db::Statement * stm
ODBC statement to use for the query.
Definition: v6/cursor.h:203
virtual bool next()
Get a new item from the results of a query.
Definition: v6/cursor.h:213
virtual void query(const Record &query)=0
Perform the query.
virtual void query(const Record &rec)
Query the data IDs only, to use to delete things.
virtual void discard_rest()
Discard the results that have not been read yet.
Structure used to build and execute a query, and to iterate through the results.
Definition: v6/cursor.h:58
virtual wreport::Var get_var() const
Get the variable.
The ODBC specification is imperfect with regards to integer sizes on 64bit platforms, and different ODBC drivers are currently interpreting it differently.
virtual void to_record(Record &rec)
Fill in a record with the contents of a dba_db_cursor.
virtual const char * get_ident(const char *def=0) const
Get the station identifier, or NULL if missing.
DB-All.E record.
Definition: record.h:102
int remaining() const
Get the number of rows still to be fetched.
Definition: v6/cursor.h:196
virtual unsigned test_iterate(FILE *dump=0)
Iterate the cursor until the end, returning the number of items.
virtual double get_lon() const
Get the station longitude.
virtual double get_lat() const
Get the station latitude.
virtual void to_record(Record &rec)
Fill in a record with the contents of a dba_db_cursor.
DBALLE_SQL_C_SINT_TYPE count
Number of results still to be fetched.
Definition: v6/cursor.h:91
Cursor(v6::DB &db, unsigned int modifiers)
Create a query cursor.
virtual void attr_insert(const Record &attrs)
Insert/overwrite new attributes for the current variable.
Functions used to connect to DB-All.e and insert, query and delete data.
virtual void discard_rest()
Discard the results that have not been read yet.
bool querybest_fields_are_the_same(const SQLRecord &r)
Checks true if ana_id, id_ltr, datetime and varcode are the same in both records. ...
virtual unsigned test_iterate(FILE *dump=0)
Iterate the cursor until the end, returning the number of items.
virtual void query(const Record &rec)
Query stats about all possible context combinations.
virtual void to_record(Record &rec)
Fill in a record with the contents of a dba_db_cursor.
v6::DB & db
Database to operate on.
Definition: v6/cursor.h:85
CursorData(DB &db, unsigned int modifiers)
Query count of items (only for stations and data)
Definition: v6/cursor.h:238
ODBC statement.
Definition: internals.h:220
virtual bool next()
Get a new item from the results of a query.
virtual const char * get_rep_memo(const char *def=0) const
Get the report name.
SQLRecord sqlrec
Results written by fetch.
Definition: v6/cursor.h:94
virtual void discard_rest()=0
Discard the results that have not been read yet.
virtual Trange get_trange() const
Get the level.
const unsigned int modifiers
Modifier flags to enable special query behaviours.
Definition: v6/cursor.h:88
Definition: v6/cursor.h:261
virtual unsigned test_iterate(FILE *dump=0)
Iterate the cursor until the end, returning the number of items.
Definition: v6/cursor.h:275
virtual Level get_level() const
Get the level.
virtual void query(const Record &rec)
Query data.
DB-ALLe database connection.
Definition: v6/db.h:87
virtual bool next()=0
Get a new item from the results of a query.
virtual unsigned test_iterate(FILE *dump=0)
Iterate the cursor until the end, returning the number of items.
Query results from SQL output.
Definition: v6/cursor.h:61
virtual wreport::Varcode get_varcode() const
Get the variable code.
virtual int get_station_id() const
Get the station identifier.
Definition: v6/cursor.h:227
virtual void query(const Record &rec)
Perform the query.
virtual void attr_remove(const AttrList &qcs)
Delete attributes for the current variable.
Definition: v6/cursor.h:244
virtual unsigned test_iterate(FILE *dump=0)
Iterate the cursor until the end, returning the number of items.
virtual unsigned test_iterate(FILE *dump=0)=0
Iterate the cursor until the end, returning the number of items.
unsigned query_attrs(const AttrList &qcs, Record &attrs)
Query attributes for the current variable.
virtual void to_record(Record &rec)
Fill in a record with the contents of a dba_db_cursor.