Esempio n. 1
0
        private void CreateExecutables()
        {
            _Sequence = new LibCF.Sequence("Example for a sequence").AddComponent(_Package);

            new LibCF.SQLTask(
                "Example for a simple sql",
                _ConnectionManager)
            .AddComponent(_Sequence)
            .AddDirectInput("create table #test ( id int not null )");

            new LibCF.SQLTask(
                "Example for a sql with result",
                _ConnectionManager)
            .AddComponent(_Sequence)
            .AddDirectInput("Select 1")
            .SetResultSetType(LibCF.ResultSetType.SingleRow)
            .AddResultSet(new LibCF.SQLResultSet("0", SQLResultVariable));

            _Sequence.ConnectAllTasks();

            new LibCF.SQLTask(
                "Example for a sql with parameter",
                _ConnectionManager)
            .AddComponent(_Package)
            .AddDirectInput(@"
create table #test ( text nvarchar(50) not null )
insert into #test values( '?' )"
                            )
            .AddParameter(new LibCF.SQLTaskParameter("0", LibCF.ParameterDirections.Input, Lib.DataType.WSTR, "ExampleVar1"));

            _Package.ConnectAllTasksWithExpression("@[User::ExampleVar2] == 1");
        }
Esempio n. 2
0
        public void EventHandler(LibCF.Package package, Lib.ConnectionManager connection)
        {
            LibCF.Sequence seq = new LibCF.Sequence("Sequence")
                                 .AddComponent(package);

            Lib.EventHandlerWrap postExecute = seq.GetPostExecuteEventHandler();

            LibCF.SQLTask sqlTask = new LibCF.SQLTask("sql task", connection)
                                    .AddComponent(seq)
                                    .AddDirectInput("SQL");
            postExecute.AddTask(sqlTask);
        }
Esempio n. 3
0
        public void PrecedenceConstraint(LibCF.Sequence seq, Lib.ConnectionManager connection)
        {
            LibCF.SQLTask sql1 = new LibCF.SQLTask("sql task", connection)
                                 .AddComponent(seq)
                                 .AddDirectInput("SQL");
            LibCF.SQLTask sql2 = new LibCF.SQLTask("sql task", connection)
                                 .AddComponent(seq)
                                 .AddDirectInput("SQL");

            new LibCF.PrecedenceConstraint(sql1, sql2, "condition, e.g. 1 > 0")
            .AddComponent(seq);
        }