0

Below is the code I'm struggling with.

import arcpy

import datetime

#Create copy of GDB 2.0 Template
date = time.strftime('%Y%m%d%H%M%S')

emptyLLDGDB = "\\\\Bvweb104draco\\e\\08_Scripts\\GDB21_LLD_VendorChanges_05Sep_V5.gdb\\GDB21_LLD_VendorChanges_05Sep_V5.gdb"

newGDB = "\\\\Bvweb104draco\\e\\08_Scripts\\Scratch\\Survey" + date

arcpy.Copy_management*(emptyLLDGDB, newGDB)

#Turn ADDRESS feature class from service into a table to be consumed by the append function
ADDRESS = r'\\Bvweb104draco\e\03_MapServices\SDE_CONNECTIONS\bvtampaprod.sde\bvtampaprod.sde.Telecom\bvtampaprod.sde.ADDRESS'

addressTableName = "Table" + date

Address_Table = "\\\\Bvweb104draco\\e\\08_Scripts\\Scratch"

arcpy.TableToTable_conversion*("ADDRESS", Address_Table, addressTableName)

#Append ADDRESS table to survey attribute table in copied GDB 2.0 

Survey_Attribute = "\\\\Bvweb104draco\\e\\08_Scripts\\Scratch\\Survey" + date + ".gdb\\Survey_Attributes"

arcpy.Append_management(addressTableName, Survey_Attributes, "NO_TEST", "LOCATION_TYPE \"LOCATION_TYPE\" true true false 50 Text 0 0 ,First,#;BLDG_TYPE \"BLDG_TYPE\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_loc_typ,-1,-1;BLDG_SUB_TYPE \"BLDG_SUB_TYPE\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_bldg_su,-1,-1;BLDG_LAT \"BLDG_LAT\" true true false 50 Text 0 0 ,First,#,Table20180918141600,latitude,-1,-1;BLDG_LONG \"BLDG_LONG\" true true false 50 Text 0 0 ,First,#,Table20180918141600,longitude,-1,-1;ALLOCATION_STATUS \"ALLOCATION_STATUS\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_alloc_s,-1,-1;NOBUILD_REASON \"NOBUILD_REASON\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_nobuild,-1,-1;CURRENT_FAC_ENTRANCE \"CURRENT_FAC_ENTRANCE\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_curr_fa,-1,-1;PROPOSED_ENTRANCE \"PROPOSED_ENTRANCE\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_prop_en,-1,-1;DROP_TYPE \"DROP_TYPE\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_drop_ty,-1,-1;VIRTUAL_TERM \"VIRTUAL_TERM\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_virtual,-1,-1;PROPOSED_TERM_HHLAT \"PROPOSED_TERM_HHLAT\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_prop_te,-1,-1;PROPOSED_TERM_HHLONG \"PROPOSED_TERM_HHLONG\" true true false 50 Text 0 0 ,First,#,Table20180918141600,bv_prop__1,-1,-1;PROPERTY_ID \"PROPERTY_ID\" true true false 4 Long 0 0 ,First,#,Table20180918141600,bv_propert,-1,-1;FIM_ADDRESS_ID \"FIM_ADDRESS_ID\" true true false 4 Long 0 0 ,First,#;FIM_SUBADDRESS_ID \"DATE_CREATED\" true true false 4 Long 0 0 ,First,#;OPERATION_TYPE \"OPERATION_TYPE\" true true false 50 Text 0 0 ,First,#;ENGG_INTERVAL \"ENGG_INTERVAL\" true true false 50 Text 0 0 ,First,#", "")

Arcpy.Append_management is appending blank rows over into the table, but when I do this in model builder it works correctly. Why would the append function append blank rows instead of actually filling it out with information?

  • 1
    Please further explain what the error is and what the end goal is – NULL.Dude Sep 19 '18 at 16:26
  • There is no error presented, it simply doesn't copy over the values into the table, it just copies blank rows when done using Python. If I do it using the actual append tool and manually direct the input/output/field mapping it works. Thanks for the help cleaning that up by the way. – GIS_GOD Sep 19 '18 at 16:30
  • 1
    It is not possible to know what you are trying to do by reading your code. Only you can decipher the append row. I think you should try using FieldMappings object to make sure the mapping of fields is correct. – BERA Sep 19 '18 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.