61 lines
910 B
Python
61 lines
910 B
Python
from pycen import con
|
|
|
|
sql1 = """
|
|
DROP VIEW IF EXISTS zones_humides.v_zh_ponctuelles;
|
|
CREATE VIEW zones_humides.v_zh_ponctuelles AS
|
|
SELECT
|
|
id,
|
|
territoire,
|
|
commune,
|
|
lieu_dit,
|
|
observer,
|
|
datemodif,
|
|
x,
|
|
y,
|
|
code_insee,
|
|
descripti2,
|
|
geom,
|
|
qui,
|
|
statut,
|
|
source,
|
|
comment,
|
|
type,
|
|
ponctuelle,
|
|
classe
|
|
FROM zones_humides.zh_ponctuelles
|
|
WHERE in_zh is False
|
|
"""
|
|
|
|
with con.begin() as cnx:
|
|
cnx.execute(sql1)
|
|
|
|
|
|
|
|
sql1 = """
|
|
DROP VIEW IF EXISTS zones_humides.v_zh_ponctuelles;
|
|
CREATE VIEW zones_humides.v_zh_ponctuelles AS
|
|
SELECT
|
|
id,
|
|
territoire,
|
|
commune,
|
|
lieu_dit,
|
|
observer,
|
|
datemodif,
|
|
x,
|
|
y,
|
|
code_insee,
|
|
descripti2,
|
|
geom,
|
|
qui,
|
|
statut,
|
|
source,
|
|
comment,
|
|
type,
|
|
ponctuelle,
|
|
classe
|
|
FROM zones_humides.zh_ponctuelles
|
|
WHERE in_zh is True
|
|
"""
|
|
|
|
with con.begin() as cnx:
|
|
cnx.execute(sql1) |