1 Reply Latest reply on Dec 23, 2016 3:50 PM by Francisco Amores

    Need to delete alldata from fdm for all locations

    2676229

      Hello Everyone,

       

      We need to delete all data from fdm for all locations.

       

      We did the following test on one location.

       

      1.Deleted data from tdataseg table where partitionkey related to that location on a particular month. we didnt see any data in tdataseg tables related to that location but we could see data in fdm.

      2.we tried to delete entry related to location x on particular month from tlogprocess table which contains the fdm import/export/validation status and then we tried to import data again but it failed.

       

       

      we got the following process to delete data from fdm

       

      mySQL = "DELETE FROM TDATAMAPSEG WHERE PARTITIONKEY IN (SELECT PARTITIONKEY FROM TPOVPARTITION WHERE PARTTARGETAPPLICATIONID = %s) " % (targetApplicationID)

                mySQL += "AND PERIODKEY = to_date('%s','yyyy-mm-dd') " % (rsPeriods.getDate("PERIODKEY"))

                mySQL += "AND CATKEY = %s" % (category)

                fdmeeAPI.logDebug(mySQL)

                rowsAffected = fdmeeAPI.executeDML(mySQL,None,False)

                fdmeeAPI.logDebug("Rows Affected: %s" %(rowsAffected))

               

                mySQL = "DELETE FROM TDATASEG WHERE PARTITIONKEY IN (SELECT PARTITIONKEY FROM TPOVPARTITION WHERE PARTTARGETAPPLICATIONID = %s) " % (targetApplicationID)

                mySQL += "AND PERIODKEY = to_date('%s','yyyy-mm-dd') " % (rsPeriods.getDate("PERIODKEY"))

                mySQL += "AND CATKEY = %s" % (category)

                fdmeeAPI.logDebug(mySQL)

                rowsAffected = fdmeeAPI.executeDML(mySQL,None,False)

                fdmeeAPI.logDebug("Rows Affected: %s" %(rowsAffected))

               

                mySQL = "DELETE FROM TLOGPROCESS WHERE PARTITIONKEY IN (SELECT PARTITIONKEY FROM TPOVPARTITION WHERE PARTTARGETAPPLICATIONID = %s) " % (targetApplicationID)

                mySQL += "AND PERIODKEY = to_date('%s','yyyy-mm-dd') " % (rsPeriods.getDate("PERIODKEY"))

                mySQL += "AND CATKEY = %s" % (category)

                fdmeeAPI.logDebug(mySQL)

                rowsAffected = fdmeeAPI.executeDML(mySQL,None,False)

                fdmeeAPI.logDebug("Rows Affected: %s" %(rowsAffected))

       

       

      Please let us know if there is any process to delete all data from fdm from all locations at once.

       

      Regards,

      Naresh