Convenience functions.
More...
|
|
std::list< driver > | nanodbc::list_drivers () |
| | Returns a list of ODBC drivers on your system.
|
| |
|
std::list< datasource > | nanodbc::list_datasources () |
| | Returns a list of ODBC data sources on your system.
|
| |
| result | nanodbc::execute (connection &conn, string const &query, long batch_operations=1, long timeout=0) |
| | Immediately opens, prepares, and executes the given query directly on the given connection.
|
| |
| void | nanodbc::just_execute (connection &conn, string const &query, long batch_operations=1, long timeout=0) |
| | Opens, prepares, and executes query directly without creating result object.
|
| |
| result | nanodbc::execute (statement &stmt, long batch_operations=1) |
| | Execute the previously prepared query now.
|
| |
| void | nanodbc::just_execute (statement &stmt, long batch_operations=1) |
| | Execute the previously prepared query now and without creating result object.
|
| |
| result | nanodbc::transact (statement &stmt, long batch_operations) |
| | Execute the previously prepared query now.
|
| |
| void | nanodbc::just_transact (statement &stmt, long batch_operations) |
| | Execute the previously prepared query now and without creating result object.
|
| |
| void | nanodbc::prepare (statement &stmt, string const &query, long timeout=0) |
| | Prepares the given statement to execute on it associated connection.
|
| |
Convenience functions.
◆ execute() [1/2]
| result nanodbc::execute |
( |
connection & |
conn, |
|
|
string const & |
query, |
|
|
long |
batch_operations = 1, |
|
|
long |
timeout = 0 |
|
) |
| |
Immediately opens, prepares, and executes the given query directly on the given connection.
- Parameters
-
| conn | The connection where the statement will be executed. |
| query | The SQL query that will be executed. |
| batch_operations | Numbers of rows to fetch per rowset. |
| timeout | The number in seconds before query timeout. Default is 0 indicating no timeout. |
- Returns
- A result set object.
- Attention
- You will want to use transactions if you are doing batch operations because it will prevent auto commits from occurring after each individual operation is executed.
- See also
- open(), prepare(), execute(), result, transaction
◆ just_execute() [1/2]
| void nanodbc::just_execute |
( |
connection & |
conn, |
|
|
string const & |
query, |
|
|
long |
batch_operations = 1, |
|
|
long |
timeout = 0 |
|
) |
| |
Opens, prepares, and executes query directly without creating result object.
- Parameters
-
| conn | The connection where the statement will be executed. |
| query | The SQL query that will be executed. |
| batch_operations | Rows to fetch per rowset, or number of batch parameters to process. |
| timeout | The number in seconds before query timeout. Default is 0 indicating no timeout. |
- Attention
- You will want to use transactions if you are doing batch operations because it will prevent auto commits from occurring after each individual operation is executed.
- See also
- open(), prepare(), execute(), result, transaction
◆ execute() [2/2]
Execute the previously prepared query now.
- Parameters
-
| stmt | The prepared statement that will be executed. |
| batch_operations | Rows to fetch per rowset, or the number of batch parameters to process. |
- Exceptions
-
- Returns
- A result set object.
- Attention
- You will want to use transactions if you are doing batch operations because it will prevent auto commits from occurring after each individual operation is executed.
- See also
- open(), prepare(), execute(), result
◆ just_execute() [2/2]
| void nanodbc::just_execute |
( |
statement & |
stmt, |
|
|
long |
batch_operations = 1 |
|
) |
| |
Execute the previously prepared query now and without creating result object.
- Parameters
-
| stmt | The prepared statement that will be executed. |
| batch_operations | Rows to fetch per rowset, or the number of batch parameters to process. |
- Exceptions
-
- Attention
- You will want to use transactions if you are doing batch operations because it will prevent auto commits from occurring after each individual operation is executed.
- See also
- open(), prepare(), execute(), result
◆ transact()
Execute the previously prepared query now.
Executes within the context of a transaction object, commits directly after execution.
- Parameters
-
| stmt | The prepared statement that will be executed in batch. |
| batch_operations | Rows to fetch per rowset, or the number of batch parameters to process. |
- Exceptions
-
- Returns
- A result set object.
- See also
- open(), prepare(), execute(), result, transaction
◆ just_transact()
| void nanodbc::just_transact |
( |
statement & |
stmt, |
|
|
long |
batch_operations |
|
) |
| |
Execute the previously prepared query now and without creating result object.
Executes within the context of a transaction object, commits directly after execution.
- Parameters
-
| stmt | The prepared statement that will be executed in batch. |
| batch_operations | Rows to fetch per rowset, or the number of batch parameters to process. |
- Exceptions
-
- See also
- open(), prepare(), execute(), result, transaction
◆ prepare()
| void nanodbc::prepare |
( |
statement & |
stmt, |
|
|
string const & |
query, |
|
|
long |
timeout = 0 |
|
) |
| |
Prepares the given statement to execute on it associated connection.
If the statement is not open throws programming_error.
- Parameters
-
| stmt | The prepared statement that will be executed in batch. |
| query | The SQL query that will be executed. |
| timeout | The number in seconds before query timeout. Default is 0 indicating no timeout. |
- See also
- open()
- Exceptions
-