示例#1
0
        public void WithNamedArgument()
        {
            var procName = ObjectName.Parse("APP.proc1");
            var arg      = new InvokeArgument("a", SqlExpression.Constant("Hello!"));

            AdminQuery.Call(procName, arg);
        }
示例#2
0
        public void WithNamedArguments()
        {
            var procName = ObjectName.Parse("APP.proc2");
            var arg1     = new InvokeArgument("a", SqlExpression.Constant("Hello"));
            var arg2     = new InvokeArgument("b", SqlExpression.Constant("World!"));

            AdminQuery.Call(procName, arg1, arg2);
        }
示例#3
0
        public void CallExternalWithArguments()
        {
            var procName = ObjectName.Parse("APP.extProc");
            var arg1     = new InvokeArgument("a", SqlExpression.Constant("Hello"));
            var arg2     = new InvokeArgument("b", SqlExpression.Constant("World!"));

            var result = AdminQuery.Call(procName, arg1, arg2);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);

            Assert.IsNotNullOrEmpty(ExternProcedureResult);
            Assert.AreEqual("Hello World!", ExternProcedureResult);
        }
示例#4
0
        public void WithOutputArgument()
        {
            var procName = ObjectName.Parse("APP.proc3");
            var arg      = new InvokeArgument("a", SqlExpression.Constant("Hello"));

            var result = AdminQuery.Call(procName, arg);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count);

            Field value;

            Assert.IsTrue(result.TryGetValue("b", out value));
            Assert.IsFalse(Field.IsNullField(value));

            Assert.AreEqual("Hello", ((SqlString)value.Value).ToString());
        }