odbc::Statement Class Reference

A simple non-prepared statement. More...

#include <statement.h>

Inheritance diagram for odbc::Statement:

odbc::ErrorHandler odbc::PreparedStatement odbc::CallableStatement

List of all members.

Public Member Functions


Detailed Description

A simple non-prepared statement.

Constructor & Destructor Documentation

virtual odbc::Statement::~Statement (  )  [virtual]

Destructor.

Destroys/closes this statement as well as all created resultsets.


Member Function Documentation

virtual bool odbc::Statement::execute ( const std::string &  sql  )  [virtual]

Execute a given SQL statement.

The statement can return multiple results. To get to the next result after processing the first one, getMoreResults() should be called.

Parameters:
sql The string to execute
Returns:
true if a resultset is available

virtual ResultSet* odbc::Statement::executeQuery ( const std::string &  sql  )  [virtual]

Execute an SQL statement, expected to return a resultset.

Example: std::auto_ptr<ResultSet> rs = std::auto_ptr<ResultSet>(stmt->executeQuery(s));

Parameters:
sql The string to execute
Returns:
A ResultSet object.

virtual int odbc::Statement::executeUpdate ( const std::string &  sql  )  [virtual]

Execute an SQL statement, expected to return an update count.

Returns:
The number of affected rows

int odbc::Statement::getUpdateCount (  ) 

Fetch the current result as an update count.

Returns:
the current result's update count (affected rows), or -1 if the result is a ResultSet or if there are no more results.

bool odbc::Statement::getMoreResults (  ) 

Check if there are more results available on this statment.

Returns:
True if this statement has more results to offer.

void odbc::Statement::setEscapeProcessing ( bool  on  ) 

Sets escape processing on or off.

For PreparedStatements, the command has been parsed on creation, so this setting won't really have any effect.

bool odbc::Statement::getEscapeProcessing (  ) 

Gets the current escape processing setting.

Returns:
true if escape processing is on, false otherwise

void odbc::Statement::close (  ) 

Closes all result sets from this execution.

This is useful if you don't wish to iterate through all remaining results, or if your driver does not auto-close cursors.


The documentation for this class was generated from the following file:
Go back to the libodbc++ homepage