상속: SqlStatement, IPlSqlStatement
예제 #1
0
        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);
        }
예제 #3
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);
        }
        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);
        }
예제 #5
0
        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);
        }
예제 #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);
        }
예제 #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);
            });
        }
예제 #9
0
 protected virtual SqlStatement VisitOpen(OpenStatement statement)
 {
     return(new OpenStatement(statement.CursorName, statement.Arguments));
 }