1 2 3 4 5 6 7 8 9 10 11 12
| req0="Select OBJECTID,CodeCommuneFK,Production,Rendement,Superficie,TypeCereales,AnneeAgricole,Trimestre FROM hhh.DBO.CerealesHiver Where TypeCereales=""'"+c+"'"" AND AnneeAgricole=""'"+a1+"'""AND Trimestre=""'"+v4+"'"
arcpy.CreateDatabaseView_management(BD_SIGMSA4, "CerHiv"+c+a1+"T"+v4, req0)
if "hhh.DBO.CerHiv"+c+a1+"T"+v4+".Production" == '0':
print "Zéro"
tkMessageBox.showinfo("Information", " Il n'y a pas de production de ce type de culture dans ce trimestre")
elif "hhh.DBO.CerHiv+"+c+a1+"T"+v4+".Production" != '0':
req1="Select Shape,CodeCommuneFK,NomCommune,Production,Rendement,Superficie,TypeCereales,AnneeAgricole,Trimestre FROM hhh.DBO.Communes,hhh.DBO.CerHiv"+c+a1+"T"+v4+" Where CodeCommune=CodeCommuneFK "
arcpy.MakeQueryLayer_management(BD_SIGMSA4, "carteCerHiv"+c+a1+"T"+v4, req1)
print "done" |
Partager