2017-04-06 18:27:47 +02:00
|
|
|
#ifndef __SQLPARSER__INSERT_STATEMENT_H__
|
|
|
|
#define __SQLPARSER__INSERT_STATEMENT_H__
|
2014-11-26 00:26:20 +01:00
|
|
|
|
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-04-21 16:15:07 +02:00
|
|
|
enum InsertType {
|
|
|
|
kInsertValues,
|
|
|
|
kInsertSelect
|
|
|
|
};
|
2016-02-27 15:01:06 +01:00
|
|
|
|
2017-04-21 16:15:07 +02:00
|
|
|
// Represents SQL Insert statements.
|
|
|
|
// Example: "INSERT INTO students VALUES ('Max', 1112233, 'Musterhausen', 2.3)"
|
|
|
|
struct InsertStatement : SQLStatement {
|
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;
|
2017-02-08 04:10:26 +01:00
|
|
|
char* tableName;
|
2017-02-08 02:06:15 +01:00
|
|
|
std::vector<char*>* columns;
|
|
|
|
std::vector<Expr*>* values;
|
|
|
|
SelectStatement* select;
|
|
|
|
};
|
2014-11-26 00:26:20 +01:00
|
|
|
|
|
|
|
} // namsepace hsql
|
2017-04-21 16:15:07 +02:00
|
|
|
|
|
|
|
#endif
|