A prepared statement. More...
#include <sqlitepp.h>
Public Member Functions | |
| Statement (Database &db) | |
| Default constructor. More... | |
| ~Statement () | |
| Destructor. | |
| void | bindString (const int n, const std::string &value) |
| Binds the nth parameter with the passed value as string. More... | |
| void | bindInt (const int n, const int value) |
| Binds the nth parameter with the passed value as integer. More... | |
| void | bindDouble (const int n, const double value) |
| Binds the nth parameter with the passed value as integer. More... | |
| void | bindNull (const int n) |
| Binds the nth parameter with the null value. More... | |
| std::string | getString (const std::string &column) const |
| gets a column as string More... | |
| int | getInt (const std::string &column) const |
| gets a column as integer More... | |
| double | getDouble (const std::string &column) const |
| gets a column as double More... | |
| void | getString (const int n, std::string &out) const |
| gets the nth column as string and saves it in out More... | |
| void | getInt (const int n, int &out) const |
| gets the nth column as integer and saves it in out More... | |
| void | getDouble (const int n, double &out) const |
| gets the nth column as string and saves it in out More... | |
| std::string | getString (const int n) const |
| gets the nth column as string More... | |
| int | getInt (const int n) const |
| gets the nth column as integer More... | |
| double | getDouble (const int n) const |
| gets the nth column as double More... | |
| void | prepare (const std::string &sql) |
| prepares a string as statement More... | |
| bool | fetchRow (void) |
| fetches the next row More... | |
| void | exec (void) |
| executes the prepared statement | |
| void | finalize (void) |
| releases any allocated resources. Use it, when you want to reuse a statement object. | |
A prepared statement.
Definition at line 183 of file sqlitepp.h.
| sqlitepp::Statement::Statement | ( | Database & | db | ) |
Default constructor.
| db | database, on which the statement is executed |
Definition at line 33 of file statement.cpp.
| void sqlitepp::Statement::bindDouble | ( | const int | n, |
| const double | value | ||
| ) |
Binds the nth parameter with the passed value as integer.
| n | |
| value |
Definition at line 179 of file statement.cpp.
| void sqlitepp::Statement::bindInt | ( | const int | n, |
| const int | value | ||
| ) |
Binds the nth parameter with the passed value as integer.
| n | |
| value |
Definition at line 167 of file statement.cpp.
| void sqlitepp::Statement::bindNull | ( | const int | n | ) |
Binds the nth parameter with the null value.
| n |
Definition at line 185 of file statement.cpp.
| void sqlitepp::Statement::bindString | ( | const int | n, |
| const std::string & | value | ||
| ) |
Binds the nth parameter with the passed value as string.
| n | |
| value |
Definition at line 173 of file statement.cpp.
| bool sqlitepp::Statement::fetchRow | ( | void | ) |
| double sqlitepp::Statement::getDouble | ( | const std::string & | column | ) | const |
| void sqlitepp::Statement::getDouble | ( | const int | n, |
| double & | out | ||
| ) | const |
gets the nth column as string and saves it in out
| n | the index |
| out | the output double |
Definition at line 161 of file statement.cpp.
| double sqlitepp::Statement::getDouble | ( | const int | n | ) | const |
| int sqlitepp::Statement::getInt | ( | const std::string & | column | ) | const |
| void sqlitepp::Statement::getInt | ( | const int | n, |
| int & | out | ||
| ) | const |
gets the nth column as integer and saves it in out
| n | the index |
| out | the output integer |
Definition at line 114 of file statement.cpp.
| int sqlitepp::Statement::getInt | ( | const int | n | ) | const |
| std::string sqlitepp::Statement::getString | ( | const std::string & | column | ) | const |
| void sqlitepp::Statement::getString | ( | const int | n, |
| std::string & | out | ||
| ) | const |
gets the nth column as string and saves it in out
| n | the index |
| out | the output string |
Definition at line 140 of file statement.cpp.
| std::string sqlitepp::Statement::getString | ( | const int | n | ) | const |
| void sqlitepp::Statement::prepare | ( | const std::string & | sql | ) |
prepares a string as statement
| sql | SQL statement |
Definition at line 49 of file statement.cpp.
1.8.5