summaryrefslogtreecommitdiff
path: root/libodbcpp/selectcommand.h
blob: 81f3ea94681009959197989aaa31c8612fe0c44c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef ODBC_SELECTCOMMAND_H
#define ODBC_SELECTCOMMAND_H

#include "../libdbpp/selectcommand.h"
#include "command.h"

namespace ODBC {
	class Column;
	class SelectCommand : public Command, public DB::SelectCommand {
			typedef std::vector<Column*> Columns;
		public:
			SelectCommand (const Connection &, const std::string & sql);
			~SelectCommand();
			bool				fetch();
			void				execute();
			const DB::Column &	operator[](unsigned int col) const;
			const DB::Column &	operator[](const Glib::ustring &) const;
			unsigned int		columnCount() const;
			unsigned int		getOrdinal(const Glib::ustring &) const;
		private:
			bool				fetch(SQLSMALLINT orientation = SQL_FETCH_NEXT, SQLLEN offset = 0);
			Columns				columns;			
	};
}

#endif