HyriseSQLParser/src/lib/statements/InsertStatement.h

42 lines
747 B
C
Raw Normal View History

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 {
/**
* @struct InsertStatement
* INSERT INTO students VALUES ('Max', 1112233, 'Musterhausen', 2.3)
* INSERT INTO employees SELECT * FROM stundents
*/
2014-12-03 17:43:02 +01:00
struct InsertStatement : SQLStatement {
enum InsertType {
2014-11-26 00:26:20 +01:00
kInsertValues,
kInsertSelect
2014-12-03 17:43:02 +01:00
};
2014-11-26 00:26:20 +01:00
2014-12-03 17:43:02 +01:00
InsertStatement(InsertType type) :
SQLStatement(kStmtInsert),
type(type),
2014-11-26 00:26:20 +01:00
table_name(NULL),
columns(NULL),
values(NULL),
select(NULL) {}
virtual ~InsertStatement(); // defined in destructors.cpp
2014-12-03 17:43:02 +01:00
InsertType type;
2014-11-26 00:26:20 +01:00
const char* table_name;
List<char*>* columns;
List<Expr*>* values;
SelectStatement* select;
};
} // namsepace hsql
#endif