public static void ProcedureTrigger_NoArguments()
        {
            var statement = new CreateProcedureTriggerStatement(ObjectName.Parse("APP.trig1"), new ObjectName("tab1"),
                ObjectName.Parse("APP.proc1"), TriggerEventTime.After, TriggerEventType.Delete);

            var expected = "CREATE TRIGGER APP.trig1 AFTER DELETE ON tab1 FOR EACH ROW CALL APP.proc1()";

            Assert.AreEqual(expected, statement.ToString());
        }
Ejemplo n.º 2
0
        public static void ProcedureTrigger_NoArguments()
        {
            var statement = new CreateProcedureTriggerStatement(ObjectName.Parse("APP.trig1"), new ObjectName("tab1"),
                                                                ObjectName.Parse("APP.proc1"), TriggerEventTime.After, TriggerEventType.Delete);

            var expected = "CREATE TRIGGER APP.trig1 AFTER DELETE ON tab1 FOR EACH ROW CALL APP.proc1()";

            Assert.AreEqual(expected, statement.ToString());
        }
        public static void ProcedureTrigger_WithArguments()
        {
            var args = new InvokeArgument[] {
                new InvokeArgument("a", SqlExpression.Constant(3))
            };

            var statement = new CreateProcedureTriggerStatement(ObjectName.Parse("APP.trig1"), new ObjectName("tab1"),
                ObjectName.Parse("APP.proc1"), args, TriggerEventTime.After, TriggerEventType.Delete) {
                    ReplaceIfExists = true,
                    Status = TriggerStatus.Enabled
                };

            var expected = "CREATE OR REPLACE TRIGGER APP.trig1 AFTER DELETE ON tab1 FOR EACH ROW ENABLE CALL APP.proc1(a => 3)";

            Assert.AreEqual(expected, statement.ToString());
        }
Ejemplo n.º 4
0
        public static void ProcedureTrigger_WithArguments()
        {
            var args = new InvokeArgument[] {
                new InvokeArgument("a", SqlExpression.Constant(3))
            };

            var statement = new CreateProcedureTriggerStatement(ObjectName.Parse("APP.trig1"), new ObjectName("tab1"),
                                                                ObjectName.Parse("APP.proc1"), args, TriggerEventTime.After, TriggerEventType.Delete)
            {
                ReplaceIfExists = true,
                Status          = TriggerStatus.Enabled
            };

            var expected = "CREATE OR REPLACE TRIGGER APP.trig1 AFTER DELETE ON tab1 FOR EACH ROW ENABLE CALL APP.proc1(a => 3)";

            Assert.AreEqual(expected, statement.ToString());
        }