I have 2 feature classes (FC) that I am merging together and then performing some field calculations on.
The 1st FC has 100k+ records in it, and the second FC is a blank FC that I'm using as a template. I need to merge the two FC's together and then field calc the values from FC1 into FC2.
The problem with FC2 is that the fields are required to often be of a different type. For example, in FC1 field "PID" is a double and in FC2 "PIN" is a string. I need to calculate the values of "PID" into "PIN" with a prefix of "139-". This pattern is repeated several times with different fields.
My simple code example:
data = r"C:\Temp\Test.gdb\PAR_PROPINFO_SCO_VW2"
template = r"C:\Temp\Test.gdb\Template"
out = r"C:\Temp\Test.gdb\Scott_CO"
arcpy.Merge_management([data,template],out)
qry= '"139-"' + "+'PID'"
arcpy.CalculateField_management(out,"PIN",qry)
In this particular instance, qry threw a syntax error.
If I just use:
arcpy.CalculateField_management(out,"PIN","PID")
I get a type mismatch error.
Since I'm on Arc 10.0, I was trying to avoid a cursor with the amount of records involved.
This process will run daily and the # of records will only increase. I was thinking I could just get away with a brute force merge and calc method. However, I run into type mismatches. I thought field mappings, but that is beyond my current level.