The RecordSetIf Interface

The record set models a particular SQL statement that can be executed on a database. The RecordSetIf objects are created using the CreateRecordSet provided by the DatabaseIf interface. There can't be any RecordSetIfs that are not associated with an open database connection obtained through DatabaseIf.

src/include/dame/recordsetif.hpp

            class RecordSetIf {
            ...
	        virtual void Execute (void) = 0 ;
	        virtual void SetColumnBuffer (int index, Util::SQLString buffer) = 0 ;
	        virtual void SetColumnBuffer (int index, int *buffer) = 0 ;
	        virtual void SetColumnBuffer (int index, double *buffer) = 0 ;
	        virtual void SetParameterBuffer (const char* name, const char *buffer, int size) = 0 ;
	        virtual void SetParameterBuffer (const char* name, const int *buffer) = 0 ;
	        virtual void SetParameterBuffer (const char* name, const double *buffer) = 0 ;
	        virtual bool End() = 0 ;
	        virtual void Next() = 0 ;
        

The RecordSetIf interface provides functionality to execute a SQL statement onto the database. The user is expected to use SetColumnBuffer and SetParameterBuffer to attach buffers. The column buffers are used by the RecordSetIf to return back values that are retrived from the database. The parameter buffers are used to pass values to the SQL statement.

Note that there are no interfaces defined to retrieve the datetime fields. The date/time column types are handled by DAME using the helper class Dame::Util::Date.

Note also that there are no transaction semantics that are enforced by the RecordSetIf class. The transactions are associated with each connection of a database and so are handled by DatabaseIf