2014-11-26 00:26:20 +01:00
|
|
|
#ifndef __INSERT_STATEMENT_H__
|
|
|
|
#define __INSERT_STATEMENT_H__
|
|
|
|
|
2014-12-03 17:43:02 +01:00
|
|
|
#include "SQLStatement.h"
|
2014-11-26 00:26:20 +01:00
|
|
|
#include "SelectStatement.h"
|
|
|
|
|
|
|
|
namespace hsql {
|
2017-02-08 02:06:15 +01:00
|
|
|
/**
|
|
|
|
* Represents SQL Insert statements.
|
|
|
|
* Example: "INSERT INTO students VALUES ('Max', 1112233, 'Musterhausen', 2.3)"
|
|
|
|
*/
|
|
|
|
struct InsertStatement : SQLStatement {
|
|
|
|
enum InsertType {
|
|
|
|
kInsertValues,
|
|
|
|
kInsertSelect
|
|
|
|
};
|
2016-02-27 15:01:06 +01:00
|
|
|
|
2017-02-08 02:06:15 +01:00
|
|
|
InsertStatement(InsertType type);
|
|
|
|
virtual ~InsertStatement();
|
2016-02-27 15:01:06 +01:00
|
|
|
|
2017-02-08 02:06:15 +01:00
|
|
|
InsertType type;
|
|
|
|
const char* tableName;
|
|
|
|
std::vector<char*>* columns;
|
|
|
|
std::vector<Expr*>* values;
|
|
|
|
SelectStatement* select;
|
|
|
|
};
|
2014-11-26 00:26:20 +01:00
|
|
|
|
|
|
|
} // namsepace hsql
|
|
|
|
#endif
|