16 lines
473 B
Python
16 lines
473 B
Python
from pycen import con_fon
|
|
|
|
id_acte = 'MU_CHAR_ZI2'
|
|
|
|
if id_acte.startswith('MF'):
|
|
lst_tab = ['r_mfstatut','r_frais_mf','r_cad_site_mf','mf_acquisitions']
|
|
key = 'mf_id'
|
|
elif id_acte.startswith('MU'):
|
|
lst_tab = ['r_mustatut','r_frais_mu','r_cad_site_mu','mu_conventions']
|
|
key = 'mu_id'
|
|
|
|
sql = "DELETE FROM foncier.{tab} WHERE {key}='{acte_id}';"
|
|
for t in lst_tab:
|
|
with con_fon.begin() as cnx:
|
|
cnx.execute(sql.format(tab=t,key=key,acte_id=id_acte))
|