Beispiel #1
0
        //-- Check orgTextual_Data_value exists or not. If column exists then move textual & numeric values into their respective column.
        public static void SeparateTextualandNemericData(DIConnection dbConnection, DIQueries dbQueries)
        {
            string SqlQuery = string.Empty;

            try
            {
                if (ISColumnExists(dbConnection, Constants.Data.Orginal_Data_valueColumn, dbQueries.TablesName.Data))
                {
                    //--Update Textual value true if data value is not Numeric
                    SqlQuery = "UPDATE " + dbQueries.TablesName.Data + " SET " + Data.IsTextualData + " = 1 WHERE NOT ISNUMERIC(" + Data.DataValue + ")";
                    dbConnection.ExecuteNonQuery(SqlQuery);

                    //-- move orgData_Value values into Data_Value
                    SqlQuery = "UPDATE " + dbQueries.TablesName.Data + "	Set "+ Constants.Data.Orginal_Data_valueColumn + "=" + Data.DataValue + " WHERE " + Data.IsTextualData + " = 0";
                    dbConnection.ExecuteNonQuery(SqlQuery);

                    //--move orgTextual_Data_value into Textual_Data_value if ISTextual is true
                    SqlQuery = "UPDATE " + dbQueries.TablesName.Data + " Set " + Constants.Data.Orginal_Textual_Data_valueColumn + " = " + Data.DataValue + " WHERE " + Data.IsTextualData + "<>0";
                    dbConnection.ExecuteNonQuery(SqlQuery);

                    //2. Remove Data_Value  column and rename orgTextual_Data_Value and orgData_Value to Textual_Data_Value and Data_value"
                    DIDataValueHelper.RemoveDataValueAndRenameOrgColumns(dbConnection, dbQueries);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }