Inheritance: SqlStatement, IPlSqlStatement
        public static void OpenCursorNoArguments()
        {
            var statement = new OpenStatement("c1");

            var sql = statement.ToString();
            var expected = "OPEN c1";

            Assert.AreEqual(expected, sql);
        }
        public static void OpenCursorNoArguments()
        {
            var statement = new OpenStatement("c1");

            var sql      = statement.ToString();
            var expected = "OPEN c1";

            Assert.AreEqual(expected, sql);
        }
        public void OpenSimple()
        {
            var statement = new OpenStatement("c1");

            statement.Execute(Query);

            var cursor = Query.FindCursor("c1");
            Assert.IsNotNull(cursor);
            Assert.AreEqual("c1", cursor.CursorInfo.CursorName);
            Assert.AreEqual(CursorStatus.Open, cursor.Status);
        }
        public static void OpenCursorWithArguments()
        {
            var statement = new OpenStatement("c1", new SqlExpression[] {
                SqlExpression.Constant(45),
                SqlExpression.VariableReference("a")
            });

            var sql      = statement.ToString();
            var expected = "OPEN c1(45, :a)";

            Assert.AreEqual(expected, sql);
        }
        public static void OpenCursorWithArguments()
        {
            var statement = new OpenStatement("c1", new SqlExpression[] {
                SqlExpression.Constant(45),
                SqlExpression.VariableReference("a")
            });

            var sql = statement.ToString();
            var expected = "OPEN c1(45, :a)";

            Assert.AreEqual(expected, sql);
        }
Exemple #6
0
        public void OpenSimple()
        {
            var statement = new OpenStatement("c1");

            statement.Execute(Query);

            var cursor = Query.FindCursor("c1");

            Assert.IsNotNull(cursor);
            Assert.AreEqual("c1", cursor.CursorInfo.CursorName);
            Assert.AreEqual(CursorStatus.Open, cursor.Status);
        }
Exemple #7
0
 protected virtual SqlStatement VisitOpen(OpenStatement statement)
 {
     return new OpenStatement(statement.CursorName, statement.Arguments);
 }
        public void OpenWithNoArguments()
        {
            var statement = new OpenStatement("c1");

            SerializeAndAssert(statement, (serialized, deserialized) => {
                Assert.IsNotNull(deserialized);
                Assert.AreEqual("c1", deserialized.CursorName);
                Assert.IsEmpty(deserialized.Arguments);
            });
        }
Exemple #9
0
 protected virtual SqlStatement VisitOpen(OpenStatement statement)
 {
     return(new OpenStatement(statement.CursorName, statement.Arguments));
 }