Ejemplo n.º 1
0
def getStates():
    try:
        conn = db.connect_db()
        cur = getCursor(conn)
        qry = "SELECT state_id, state_name from state"
        cur.execute(qry)
        result = cur.fetchall()
        return result
    except ValueError:
        print("Error getting States : ".format(ValueError))
Ejemplo n.º 2
0
def getRegions():
    try:
        conn = db.connect_db()
        cur = getCursor(conn)
        qry = "SELECT region_id, region_name from region"
        cur.execute(qry)
        result = cur.fetchall()
        return result
    except ValueError:
        print("Error getting regions : ".format(ValueError))
Ejemplo n.º 3
0
def getDistricts():
    try:
        conn = db.connect_db()
        cur = getCursor(conn)
        qry = "SELECT district_id, district_name from district"
        cur.execute(qry)
        result = cur.fetchall()
        return result
    except ValueError:
        print("Error getting districts : ".format(ValueError))