I am trying to use python to look through an access table containing facilities that need to have geodatabases with geodatabases that already exist in order to generate a list of facility geodatabases that still need to be created. The script is working but the loop is stopping at the first record of the table and not continuing to page through the rest of the records. Here is what I have:
lookuptbl = r"P:\\USACE Mobile 0610-01 2010 63D RSC NR Contract\\03-Source Documents\\GIS\\SITE_ID_LOOKUP.mdb\\new_facility" q = '[include_in_gis] = ' + "'" + "X" + "'" rows = gp.SearchCursor(lookuptbl, q) row = rows.next() while row: facil_id = row.GetValue("facil_id") lookuptbl2 = r"P:\\USACE Mobile 0610-01 2010 63D RSC NR Contract\\03-Source Documents\\GIS\\SITE_ID_LOOKUP.mdb\\gdbs" q2 = '[facil_id_in_gdbs] = ' + "'" + facil_id + "'" #IF q is satisfied, the gdb that is currently being processed was found in lookup table; #If q is NOT satisfied, the script will skip the gdb alltogether; nothing will be done rows = gp.SearchCursor(lookuptbl2, q2) row = rows.next() while row: print facil_id + "--already exists" row = rows.next() row = rows.next()
I'm new to scripts so any help would be appreciated. Thanks!