public static void Evaluate(DeclareCursorStatement declare, Scope scope) { var query = declare.CursorDefinition.Select.QueryExpression; var scroll = declare.CursorDefinition.Options.Any(x => x.OptionKind == CursorOptionKind.Scroll); scope.Env.Vars.Declare(declare.Name.Value, new Cursor(query, scroll)); }
public void ProcessCursorStatement(DeclareCursorStatement CursorStatement) { if (CursorStatement.CursorDefinition == null || CursorStatement.CursorDefinition.Options.Count == 0) { _smells.SendFeedBack(29, CursorStatement); } }
public void DeclareCursor() { var query = (SqlQueryExpression)SqlExpression.Parse("SELECT * FROM table1, table2"); var statement = new DeclareCursorStatement("c1", query); SerializeAndAssert(statement, (serialized, deserialized) => { Assert.IsNotNull(deserialized); Assert.AreEqual("c1", deserialized.CursorName); Assert.IsNotNull(deserialized.QueryExpression); }); }
public DeclareCursorStatement ParseDeclareCursor(DeclareCursorContext node) { DeclareCursorStatement statement = new DeclareCursorStatement(); statement.CursorName = new TokenInfo(node.uid()) { Type = TokenType.CursorName }; statement.SelectStatement = this.ParseSelectStatement(node.selectStatement()); return(statement); }
public override void Visit(DeclareCursorStatement node) { this.action(node); }
public override void ExplicitVisit(DeclareCursorStatement fragment) { _fragments.Add(fragment); }