Beispiel #1
0
        public MQT(Database database, string schema, string name)
        {
            this.database = database;
            this.schema = schema;
            this.name = name;

            indexes = new MQTIndexes(this);

            load();
        }
Beispiel #2
0
 //public StoredProcedure(Database database, string catalog, string schema, string name, string type, string remarks)
 public Function(Database database, string catalog, string schema, string name)
 {
     this.database = database;
     this.catalog = catalog;
     this.schema = schema;
     this.name = name;
     //this.type = type;
     //this.remarks = remarks;
     load();
 }
Beispiel #3
0
        //public StoredProcedure(Database database, string catalog, string schema, string name, string type, string remarks)
        public StoredProcedure(Database database, string catalog, string schema, string name)
        {
            this.database = database;
            this.catalog = catalog;
            this.schema = schema;
            this.name = name;
            //this.type = type;
            //this.remarks = remarks;

            load();
        }
Beispiel #4
0
        public View(Database database, string catalog, string schema, string name, string type, string remarks)
        {
            this.database = database;
            this.catalog = catalog;
            this.schema = schema;
            this.name = name;
            this.type = type;
            this.remarks = remarks;

            load();
        }
Beispiel #5
0
        public Table(Database database, string catalog, string schema, string name, string type, string remarks, string dial)
        {
            this.database = database;
            this.catalog = catalog;
            this.schema = schema;
            this.name = name;
            this.type = type;
            this.remarks = remarks;

            columns = new Columns(this);
            columns.load();

            primaryKey = new PrimaryKey(this);
            primaryKey.load();

            //foreignKey = new ForeignKey(this);
            //foreignKey.load();

            indexes = new Indexes(this);

            triggers = new Triggers(this);

            insert = new OdbcCommand();

            //insert.CommandText = "insert into " + schema + "." + name;
            insert.CommandText = "insert into " + name;

            insert.CommandText += "(";

            int ordinal = 0;

            if (dial.ToUpper() == "DB2")
            {
                foreach (Column column in columns.Values)
                {
                    if (ordinal != 0)
                        insert.CommandText += ",";
                    insert.CommandText += column.name;
                    ordinal++;
                }
            }
            else
            {
                foreach (Column column in columns.Values)
                {
                    if (ordinal != 0)
                        insert.CommandText += ",";
                    insert.CommandText += "[" + column.name + "]";
                    ordinal++;
                }
            }

            insert.CommandText += ") values (";

            insert.CommandType = CommandType.Text;
            insert.Connection = database.connection;

            ordinal = 0;

            foreach (Column column in columns.Values)
            {
                if (ordinal != 0)
                    insert.CommandText += ",";
                // ODBC does not support named parameters
                //insert.CommandText += "@" + column.name;
                insert.CommandText += "?";
                ordinal++;

                insert.Parameters.Add(column.parameter);
            }

            insert.CommandText += ")";
        }
 public ForeignKeyRefresh(Database database,string tempTableSchema)
 {
     this.database = database;
     this.TableSchema = tempTableSchema;
 }
        private void MetaData(Database database)
        {
            DataTable tables;
            DataRow row;

            //tables = database.connection.GetSchema();
            //tables = database.connection.GetSchema("MetaDataCollections");
            //tables = database.connection.GetSchema("DataSourceInformation");
            //tables = database.connection.GetSchema("DataTypes");
            //tables = database.connection.GetSchema("Restrictions");
            //tables = database.connection.GetSchema("Tables");
            //tables = database.connection.GetSchema("Tables", new String[] { null, null, "ADM_BATCH_START_SEQUENCES" });
            //tables = database.connection.GetSchema("Columns", new String[] { null, null, "ADM_BATCH_START_SEQUENCES" });
            //tables = database.connection.GetSchema("Columns", new String[] { null, null, "ADM_COMPANY_CARD_CUSTOMERS" });
            //tables = database.connection.GetSchema("Indexes", new String[] { null, null, "ADM_BATCH_START_SEQUENCES" });
            tables = database.connection.GetSchema("Indexes", new String[] { null, null, "EXPLAIN_STATEMENT" });
            //tables = database.connection.GetSchema("Views");
            //tables = database.connection.GetSchema("Columns", new String[] { null, null, "MNU_NODES" });

            int rowIndex;
            int colIndex;

            for (colIndex = 0; colIndex < tables.Columns.Count; colIndex++)
                log.log(Logger.LogLevel.info, tables.Columns[colIndex].ColumnName);

            log.log(Logger.LogLevel.info, "");
            log.log(Logger.LogLevel.info, "");

            string text;

            for (rowIndex = 0; rowIndex < tables.Rows.Count; rowIndex++)
            {
                text = tables.Rows[rowIndex].ItemArray[0].ToString();

                for (colIndex = 1; colIndex < tables.Columns.Count; colIndex++)
                {
                    text += " - ";
                    text += tables.Rows[rowIndex].ItemArray[colIndex].ToString();
                }

                log.log(Logger.LogLevel.info, text);
            }
        }
        private void DbOpen()
        {
            log.log(Logger.LogLevel.progress, "");
            log.log(Logger.LogLevel.progress, "OPENNING DATABASES...");
            log.log(Logger.LogLevel.progress, "");
            log.indent();

            log.phaseUpdate("DB Connect");
            log.statusUpdate("Open Source");

            //_source = new Database("Source", "tstcompassaz2", "RMSE2REF", "Driver={IBM DB2 ODBC DRIVER};Hostname=tstcompassaz2;Port=50001;Protocol=TCPIP;Database=RMSE2REF;UID=db2admin;PWD=pT88!S@fe;");
            //_source = new Database("Source", "tstcompassaz2", "RMSE2V3", "Driver={IBM DB2 ODBC DRIVER};Hostname=tstcompassaz2;Port=50001;Protocol=TCPIP;Database=RMSE2V3;UID=db2admin;PWD=pT88!S@fe;");
            //_source = new Database("Source", "tstcompassaz2", "ESMREF", "Driver={IBM DB2 ODBC DRIVER};Hostname=tstcompassaz2;Port=50001;Protocol=TCPIP;Database=ESMREF;UID=db2admin;PWD=pT88!S@fe;");
            //_source = new Database("Source", "tstcompassaz2", "RMSE2TST", "Driver={IBM DB2 ODBC DRIVER};Hostname=tstcompassaz2;Port=50001;Protocol=TCPIP;Database=RMSE2TST;UID=db2admin;PWD=pT88!S@fe;");
            _source = new Database("Source", sourceSource.server, sourceSource.name, sourceSource.connectionString);

            log.statusUpdate("Open Target");
            //_target = new Database("Target", "WRK-CEO-AZ1", "RMSE2LOC", "Driver={IBM DB2 ODBC DRIVER};Hostname=wrk-ceo-az1;Port=50000;Protocol=TCPIP;Database=RMSE2LOC;UID=db2admin;PWD=pT88!S@fe;");
            //_target = new Database("Target", "LAP-CEO-AZ2", "RMSE2LOC", "Driver={IBM DB2 ODBC DRIVER};Hostname=lap-ceo-az2;Port=50000;Protocol=TCPIP;Database=RMSE2LOC;UID=db2admin;PWD=pT88!S@fe;");
            //_target = new Database("Target", "cgunx82", "RMSINT01", "Driver={IBM DB2 ODBC DRIVER};Hostname=cgunx82;Port=55001;Protocol=TCPIP;Database=RMSINT01;UID=appint;PWD=RMSeeR0cK5;");
            //_target = new Database("Target", "cgunx188", "ESMDEV01", "Driver={IBM DB2 ODBC DRIVER};Hostname=cgunx188;Port=51001;Protocol=TCPIP;Database=ESMDEV01;UID=appint;PWD=sp1derw3b$$5");
            //_target = new Database("Target", "WRK-CEO-AZ1", "RMSE2SQL", "Driver={SQL Native Client};Server=wrk-ceo-az1;Database=RMSE2SQL;UID=RMSe2;PWD=RMSe2;");
            //_target = new Database("Target", "LAP-CEO-AZ2", "RMSE2SQL", "Driver={SQL Native Client};Server=lap-ceo-az2;Database=RMSE2SQL;UID=RMSe2;PWD=RMSe2;");
            //_target = new Database("Target", "172.29.19.138", "RMSE2SQL", "Driver={SQL Native Client};Server=172.29.19.138;Database=RMSE2SQL;UID=RMSe2;PWD=RMSe2;");
            //_target = new Database("Target", "cgunx188", "RMSE2TST", "Driver={IBM DB2 ODBC DRIVER};Hostname=cgunx188;Port=51001;Protocol=TCPIP;Database=RMSE2TST;UID=appint;PWD=sp1derw3b$$5");

            _target = new Database("Target", targetTarget.server, targetTarget.name, targetTarget.connectionString);

            //source = new OdbcConnection("Driver={IBM DB2 ODBC DRIVER};Hostname=tstcompassaz2;Port=50001;Protocol=TCPIP;Database=RMSE2REF;UID=db2admin;PWD=pT88!S@fe;");
            ////target = new OdbcConnection("Driver={IBM DB2 ODBC DRIVER};Hostname=wrk-ceo-az1;Port=50000;Protocol=TCPIP;Database=RMSE2LOC;UID=db2admin;PWD=pT88!S@fe;");
            //target = new OdbcConnection("Driver={SQL Native Client};Server=wrk-ceo-az1;Database=RMSe2;UID=RMSe2;PWD=RMSe2;");

            source.open();
            target.open();

            log.unindent();
            log.log(Logger.LogLevel.progress, "");
            log.log(Logger.LogLevel.progress, "DATABASES OPEN.");
        }