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));
        }
Esempio n. 2
0
 public void ProcessCursorStatement(DeclareCursorStatement CursorStatement)
 {
     if (CursorStatement.CursorDefinition == null || CursorStatement.CursorDefinition.Options.Count == 0)
     {
         _smells.SendFeedBack(29, CursorStatement);
     }
 }
Esempio n. 3
0
        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);
            });
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public override void Visit(DeclareCursorStatement node) { this.action(node); }
 public override void ExplicitVisit(DeclareCursorStatement fragment)
 {
     _fragments.Add(fragment);
 }