Zen
A cross-platform functional programming language
|
SQL query statement. More...
#include <zbl.hpp>
Public Member Functions | |
statement (database &db, const z::string &sql) | |
Default constructor. | |
bool | next () |
Fetch the next record, execute the sql query when first called. | |
bool | exec () |
Execute the sql statement. | |
void | finish () |
Free up statement resources. | |
int | insert () |
Insert a record. | |
void | bind (const z::string &key, const z::any &val) |
Bind a query argument. | |
any | getVar (const int &idx) |
Get any value. | |
Private Attributes | |
database & | _db |
The database. | |
QSqlQuery | _val |
The value. |
SQL query statement.
Default constructor.
db | The database for the statement |
sql | The SQL query |
Bind a query argument.
key | Name of argument |
val | Value to bind |
bool exec | ( | ) | [inline] |
Execute the sql statement.
z::any getVar | ( | const int & | idx | ) |
Get any value.
idx | Column number of value to fetch |
int insert | ( | ) |
Insert a record.
bool next | ( | ) | [inline] |
Fetch the next record, execute the sql query when first called.