protected override void ExecuteStatement(ExecutionContext context)
{
//if (!context.User.CanSelectFrom(QueryPlan))
// throw new SecurityException();
var cursor = new NativeCursor(new NativeCursorInfo(QueryPlan), context.Request);
var table = context.Request.Access().GetMutableTable(TableName);
if (table == null)
throw new StatementException(String.Format("Referenced table of the INTO statement '{0}' was not found or is not mutable.", TableName));
int count;
try {
context.Query.Session.Enter(table, AccessType.Write);
count = InsertIntoTable(table, cursor);
} finally {
context.Query.Session.Exit(table, AccessType.Write);
}
context.SetResult(count);
}