libdballe  6.8
Public Member Functions | Data Fields
dballe::db::v6::Data Struct Reference

Precompiled query to manipulate the data table. More...

#include <data.h>

Public Member Functions

 Data (v6::DB &conn)
 
void set_date (const Record &rec)
 Set the date from the date information in the record.
 
void set_station_info ()
 Set id_lev_tr and datetime to mean 'station information'.
 
void set_id_lev_tr (int id)
 Set id_lev_tr to a valid value.
 
void set (const wreport::Var &var)
 Set the value input fields using a wreport::Var.
 
void set_value (const char *value)
 Set the value input fields using a string value.
 
void insert_or_fail (bool want_id=false)
 Insert an entry into the data table, failing on conflicts. More...
 
bool insert_or_ignore (bool want_id=false)
 Insert an entry into the data table, ignoring conflicts. More...
 
void insert_or_overwrite (bool want_id=false)
 Insert an entry into the data table, overwriting on conflicts. More...
 
void dump (FILE *out)
 Dump the entire contents of the table to an output stream.
 

Data Fields

v6::DBdb
 DB connection. More...
 
db::Statementistm
 Precompiled insert statement.
 
db::Statementustm
 Precompiled update statement.
 
db::Statementioustm
 Precompiled insert or update statement, for DBs where it is available.
 
db::Statementiistm
 Precompiled insert or ignore statement.
 
db::Statementsidstm
 Precompiled select ID statement.
 
DBALLE_SQL_C_SINT_TYPE id
 data ID SQL parameter
 
DBALLE_SQL_C_SINT_TYPE id_station
 Station ID SQL parameter.
 
DBALLE_SQL_C_SINT_TYPE id_report
 Report ID SQL parameter.
 
DBALLE_SQL_C_SINT_TYPE id_lev_tr
 Context ID SQL parameter.
 
SQL_TIMESTAMP_STRUCT date
 Date SQL parameter.
 
wreport::Varcode id_var
 Variable type SQL parameter.
 
char value [255]
 Variable value SQL parameter.
 
SQLLEN value_ind
 Variable value indicator.
 

Detailed Description

Precompiled query to manipulate the data table.

Member Function Documentation

void dballe::db::v6::Data::insert_or_fail ( bool  want_id = false)

Insert an entry into the data table, failing on conflicts.

Trying to replace an existing value will result in an error.

bool dballe::db::v6::Data::insert_or_ignore ( bool  want_id = false)

Insert an entry into the data table, ignoring conflicts.

Trying to replace an existing value will do nothing.

Returns
true if it was inserted, false if it was already present
void dballe::db::v6::Data::insert_or_overwrite ( bool  want_id = false)

Insert an entry into the data table, overwriting on conflicts.

An existing data with the same context and ::dba_varcode will be overwritten.

If id is not NULL, it stores the database id of the inserted/modified data in *id.

Field Documentation

v6::DB& dballe::db::v6::Data::db

DB connection.


The documentation for this struct was generated from the following file: