| 123456789101112131415161718192021222324252627282930 |
- '''
- @author: olivier.massot
- '''
- from path import Path
- from core.pde import AgrhumDb, PdaDb
- if __name__ == "__main__":
- # reinitialise les données pour les tests de ctrl2analytique.py
- PdaDb._path = Path(r"\\h2o\local\4-transversal\BDD\mdb_test\PDA\db_PDA.mdb")
- AgrhumDb._path = Path(r"\\h2o\local\4-transversal\BDD\mdb_test\BDD_ParcRH.mdb")
- pda_db = PdaDb(autocommit=True)
- agrhum_db = AgrhumDb(autocommit=False)
- moisrh = 6
- anneerh = 2018
- for codeagent in ("T5", "T30", "T9"):
- pda_db.execute("DELETE * FROM tbl_Import_tmp1 WHERE [CodeAgent]='{}' and month([ddebut])={} and year([ddebut])={}".format(codeagent, moisrh, anneerh))
- agrhum_db.execute("DELETE * FROM tbl_ImportRH WHERE [CodeAgent]='{}' and month([DateRH])={} and year([DateRH])={}".format(codeagent, moisrh, anneerh))
- agrhum_db.execute("DELETE * FROM tbl_SuiviRH WHERE [CodeAgent]='{}' and MoisRH={} and AnneeRH={}".format(codeagent, moisrh, anneerh))
- pda_db.commit()
- agrhum_db.commit()
|