import sqlite3

# establecer la concexión  
conexion = sqlite3.connect("db.sqlite3")

# crear un cursor para realizar la consulta
consulta = conexion.cursor()

# crear un cursor para realizar la consulta
consulta = conexion.cursor()
# insertar datos en una tabla BARRIOS
reg1 = ("SAN CAYETANO","")
reg2 = ("BELGRANO","")
reg3 = ("LAMADRID","")
reg4 = ("MITRE","")
reg5 = ("JUAN DOMINGO PERON","")
reg6 = ("SARMIENTO","")
reg7 = ("CENTRO","")
reg8 = ("NUEVO","")
reg9 = ("PRIMERO DE MAYO","")
reg10 = ("DON ORIONE","")
reg11 = ("ORO BLANCO","")
reg12 = ("EVITA","")
reg13 = ("LOMA LINDA","")
reg14 = ("MATADERO","")
reg15 = ("TECHO DIGNO","")
reg16 = ("EX CAESA","")
reg17 = ("SAN CARLOS","")
reg18 = ("ARCE","")
reg19 = ("NESTOR KIRCHNER","")
reg20 = ("LA SALADA","")
reg21 = ("ENSANCHE SUR","")
reg22 = ("OBLIGADO","")
reg23 = ("NUEVO VITÓN","")
reg24 = ("JUAN XXIII","")
reg25 = ("LA ESPERANZA","")
reg26 = ("SANTA CATALINA","")
reg27 = ("SANTA ANA","")
reg28 = ("EL PICAFLOR","")
reg29 = ("ENSANCHE NORTE","")
reg30 = ("SAENZ PEÑA","")
reg31 = ("EULOGIO CACERES","")
reg32 = ("SANTA MONICA","")
reg33 = ("134 VIVIENDAS","")
reg34 = ("OBRERO","")
reg35 = ("SANTA TERESITA","")
reg36 = ("NALÁ","")
reg37 = ("NAM QOM","")
reg38 = ("TOBA","")
reg39 = ("RESERVA ESTE","")
reg40 = ("MONSEÑOR DE CARLO","")
reg41 = ("PROGRESO","")
reg42 = ("BANCARIO","")
reg43 = ("MUNICIPAL","")
reg44 = ("ZAFRA","")
reg45 = ("SAN JOSE","")
reg46 = ("MILENIUM","")
reg47 = ("17 DE OCTUBRE","")
reg48 = ("PABLO VI","")
reg49 = ("SAN MARTÍN","")
reg50 = ("ISLA SOLEDAD","")
reg51 = ("CEMENTERIO","")
reg52 = ("PIÑEYRO","")
reg53 = ("PUIGBÓ","")
reg54 = ("MARIANO MORENO","")
reg55 = ("JARDÍN","")
reg56 = ("TIRO FEDERAL","")
reg57 = ("GINES BENITEZ","")
reg58 = ("YAPEYU","")
reg59 = ("RAMSEYER","")
reg60 = ("SANTA ELENA","")
reg61 = ("PUERTA DEL SOL","")
reg62 = ("JOSE RUCCI","")
reg63 = ("PARQUE NORTE","")
reg64 = ("SAGRADO CORAZON","")
reg65 = ("COLON","")
reg66 = ("FIBRALIN","")
reg67 = ("FEDERAL 20 VIVIENDAS","")
reg68 = ("AIPO","")
reg69 = ("SOLIDARIO","")
reg70 = ("4 DE JUNIO","")
reg71 = ("2 DE ABRIL","")
reg72 = ("FONAVI","")
reg73 = ("ALBORADA","")






sql = "INSERT INTO app_campaing_barrio(nombre,detalle) VALUES(?,?)"
err = False
try:
	consulta.execute(sql,reg1)
	consulta.execute(sql,reg2)
	consulta.execute(sql,reg3)
	consulta.execute(sql,reg4)
	consulta.execute(sql,reg5)
	consulta.execute(sql,reg6)
	consulta.execute(sql,reg7)
	consulta.execute(sql,reg8)
	consulta.execute(sql,reg9)
	consulta.execute(sql,reg10)
	consulta.execute(sql,reg11)
	consulta.execute(sql,reg12)
	consulta.execute(sql,reg13)
	consulta.execute(sql,reg14)
	consulta.execute(sql,reg15)
	consulta.execute(sql,reg16)
	consulta.execute(sql,reg17)
	consulta.execute(sql,reg18)
	consulta.execute(sql,reg19)
	consulta.execute(sql,reg20)
	consulta.execute(sql,reg21)
	consulta.execute(sql,reg22)
	consulta.execute(sql,reg23)
	consulta.execute(sql,reg24)
	consulta.execute(sql,reg25)
	consulta.execute(sql,reg26)
	consulta.execute(sql,reg27)
	consulta.execute(sql,reg28)
	consulta.execute(sql,reg29)
	consulta.execute(sql,reg30)
	consulta.execute(sql,reg31)
	consulta.execute(sql,reg32)
	consulta.execute(sql,reg33)
	consulta.execute(sql,reg34)
	consulta.execute(sql,reg35)
	consulta.execute(sql,reg36)
	consulta.execute(sql,reg37)
	consulta.execute(sql,reg38)
	consulta.execute(sql,reg39)
	consulta.execute(sql,reg40)
	consulta.execute(sql,reg41)
	consulta.execute(sql,reg42)
	consulta.execute(sql,reg43)
	consulta.execute(sql,reg44)
	consulta.execute(sql,reg45)
	consulta.execute(sql,reg46)
	consulta.execute(sql,reg47)
	consulta.execute(sql,reg48)
	consulta.execute(sql,reg49)
	consulta.execute(sql,reg50)
	consulta.execute(sql,reg51)
	consulta.execute(sql,reg52)
	consulta.execute(sql,reg53)
	consulta.execute(sql,reg54)
	consulta.execute(sql,reg55)
	consulta.execute(sql,reg56)
	consulta.execute(sql,reg57)
	consulta.execute(sql,reg58)
	consulta.execute(sql,reg59)
	consulta.execute(sql,reg60)
	consulta.execute(sql,reg61)
	consulta.execute(sql,reg62)
	consulta.execute(sql,reg63)
	consulta.execute(sql,reg64)
	consulta.execute(sql,reg65)
	consulta.execute(sql,reg66)
	consulta.execute(sql,reg67)
	consulta.execute(sql,reg68)
	consulta.execute(sql,reg69)
	consulta.execute(sql,reg70)
	consulta.execute(sql,reg71)
	consulta.execute(sql,reg72)
	consulta.execute(sql,reg73)




except :
	err = True
	conexion.rollback()

if not err:
	conexion.commit()
	print("BARRIOS REGISTRADOS!")
else:
	conexion.rollback()
	print("NO SE PUDIERON REGISTRAR LOS DATOS BARRIO!")


consulta.close()
conexion.close()



