protected override void ExecuteStatement(ExecutionContext context)
{
var results = context.Query.ExecuteQuery(Query);
if (results.Length != 1)
throw new StatementException("Too many queries were executed.");
var result = results[0];
if (result.Type == StatementResultType.Exception)
throw result.Error;
if (result.Type != StatementResultType.CursorRef)
throw new StatementException("Invalid result for query");
context.SetCursor(result.Cursor);
}