I work for an organization that just upgraded from esri arcmap 9.3.1 to 10.2.1 and I'm currently in the process of updating the python scripts. When running a script I'm getting hung up on a portion that imports data from a database connection. The portion of the script is below:
arcpy.MakeTableView_management(ext_parcel_base, view_parcel_base_temp, "status = 'A'", "", "lrsn lrsn VISIBLE NONE;last_update last_update VISIBLE NONE;status status HIDDEN NONE;parcel_id parcel_id VISIBLE NONE;parent_lrsn parent_lrsn HIDDEN NONE;parent_parcel_id parent_parcel_id HIDDEN NONE;county_number county_number HIDDEN NONE;township_number township_number HIDDEN NONE;district_number district_number HIDDEN NONE;corporation_id corporation_id HIDDEN NONE;section_plat section_plat HIDDEN NONE;routing_number routing_number HIDDEN NONE;neighborhood neighborhood VISIBLE NONE;property_class property_class VISIBLE NONE;prop_street prop_street VISIBLE NONE;prop_city prop_city VISIBLE NONE;prop_state prop_state VISIBLE NONE;prop_zip prop_zip VISIBLE NONE;number_cards number_cards HIDDEN NONE;owner1 owner1 VISIBLE NONE;owner2 owner2 VISIBLE NONE;own_street own_street VISIBLE NONE;own_city own_city VISIBLE NONE;own_state own_state VISIBLE NONE;own_zip own_zip VISIBLE NONE;tax_bill_id tax_bill_id HIDDEN NONE;assoc_parcel_id assoc_parcel_id HIDDEN NONE;assemblage_parcel assemblage_parcel HIDDEN NONE;lock_flag lock_flag HIDDEN NONE;reval_neigh reval_neigh HIDDEN NONE;hmstd_code hmstd_code HIDDEN NONE;assoc_name assoc_name HIDDEN NONE;deed_book deed_book HIDDEN NONE;deed_page deed_page HIDDEN NONE;condo_pct_int condo_pct_int HIDDEN NONE;condo_field1 condo_field1 HIDDEN NONE;condo_field2 condo_field2 HIDDEN NONE;condo_field3 condo_field3 HIDDEN NONE;future_hmstd_code future_hmstd_code HIDDEN NONE;hmstd_eff_year hmstd_eff_year HIDDEN NONE;par_base_int1 par_base_int1 HIDDEN NONE;par_base_int2 par_base_int2 HIDDEN NONE;par_base_int3 par_base_int3 HIDDEN NONE;par_base_flag1 par_base_flag1 HIDDEN NONE;par_base_flag2 par_base_flag2 HIDDEN NONE;nei_rating nei_rating HIDDEN NONE;legal_acreage legal_acreage VISIBLE NONE;contract_owner1 contract_owner1 HIDDEN NONE;contract_owner2 contract_owner2 HIDDEN NONE;contract_street contract_street HIDDEN NONE;contract_city contract_city HIDDEN NONE;contract_state contract_state HIDDEN NONE;contract_zip contract_zip HIDDEN NONE;value_allocation value_allocation HIDDEN NONE;nei_rating2 nei_rating2 HIDDEN NONE;condo_type condo_type HIDDEN NONE;condo_level condo_level HIDDEN NONE")
arcpy.TableToTable_conversion(view_parcel_base_temp, sde, "parcel_base_temp", "", "lrsn 'lrsn' true true false 4 Long 0 10 ,First,#,"+ ext_parcel_base +",lrsn,-1,-1;last_update 'last_update' true true false 16 Date 0 0 ,First,#,"+ ext_parcel_base +",last_update,-1,-1;parcel_id 'parcel_id' true true false 26 Text 0 0 ,First,#,"+ ext_parcel_base +",parcel_id,-1,-1;neighborhood 'neighborhood' true true false 4 Long 0 10 ,First,#,"+ ext_parcel_base +",neighborhood,-1,-1;property_class 'property_class' true true false 4 Long 0 10 ,First,#,"+ ext_parcel_base +",property_class,-1,-1;prop_street 'prop_street' true true false 40 Text 0 0 ,First,#,"+ ext_parcel_base +",prop_street,-1,-1;prop_city 'prop_city' true true false 30 Text 0 0 ,First,#,"+ ext_parcel_base +",prop_city,-1,-1;prop_state 'prop_state' true true false 2 Text 0 0 ,First,#,"+ ext_parcel_base +",prop_state,-1,-1;prop_zip 'prop_zip' true true false 10 Text 0 0 ,First,#,"+ ext_parcel_base +",prop_zip,-1,-1;owner1 'owner1' true true false 36 Text 0 0 ,First,#,"+ ext_parcel_base +",owner1,-1,-1;owner2 'owner2' true true false 36 Text 0 0 ,First,#,"+ ext_parcel_base +",owner2,-1,-1;own_street 'own_street' true true false 40 Text 0 0 ,First,#,"+ ext_parcel_base +",own_street,-1,-1;own_city 'own_city' true true false 30 Text 0 0 ,First,#,"+ ext_parcel_base +",own_city,-1,-1;own_state 'own_state' true true false 2 Text 0 0 ,First,#,"+ ext_parcel_base +",own_state,-1,-1;own_zip 'own_zip' true true false 10 Text 0 0 ,First,#,"+ ext_parcel_base +",own_zip,-1,-1;legal_acreage 'legal_acreage' true true false 8 Double 4 10 ,First,#,"+ ext_parcel_base +",legal_acreage,-1,-1", "")
arcpy.AddIndex_management(sde_parcel_base_temp, "parcel_id", "parcelid", "NON_UNIQUE", "NON_ASCENDING")
This results in an error:
File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\conversion.py", line 2018, in TableToTable raise e ExecuteError: ERROR 001156: Failed on input OID -1, could not write value ' ' to output field prop_city Failed to execute (TableToTable).
I'm not very advanced in python and i understand it means:
A value could not be added to the output field. For example, text values cannot be added to numeric fields, and text values cannot be added to text fields if the values are longer than the field length.
Do you have an idea what i need to do to fix this?
"\"status\" = 'A'"
or''' "status" = 'A' '''