Beispiel #1
0
def replace_loc(script):

    c.execute("DROP TABLE IF EXISTS temp1")
    c.execute("CREATE TEMPORARY TABLE temp1 (jaro_match_value FLOAT, count INTEGER, \
        cityA TEXT, stateA TEXT, countryA TEXT, ncity TEXT, nstate TEXT, ncountry TEXT, nlat FLOAT, nlong FLOAT);")
    c.execute("INSERT OR REPLACE INTO temp1 %s;" % script)

    #print_table_info(c)

    # TODO: Which tables will pass this conditional?
    if table_temp1_has_rows(c):
        geocode_replace_loc.create_loc_and_locmerge_tables(c)
        geocode_replace_loc.print_loc_and_merge(c)

    conn.commit()
Beispiel #2
0
def replace_loc(script):

    c.execute("DROP TABLE IF EXISTS temp1")
    c.execute("CREATE TEMPORARY TABLE temp1 AS %s" % script)
    # Apparently, this tmp1_idx is either superfluous or redundant.
    #c.execute("CREATE INDEX IF NOT EXISTS tmp1_idx ON temp1 (CityA, StateA, CountryA, ZipcodeA)")

    #print_table_info(c)

    # TODO: Which tables will pass this conditional?
    if table_temp1_has_rows(c):
        geocode_replace_loc.create_loc_and_locmerge_tables(c)
        geocode_replace_loc.print_loc_and_merge(c)

    conn.commit()