I have a feature class and table. The table contains about 18000 data. the polygon feature class contain 269 data. Both common column are [MAHALLE_AD] and [Mahalle]. Also Both are same personal geodatabase. I want to transfer from table data (18000) to feature class using common column. Make Query Table Screenshot

Make Query Table Screenshot_2

I get comment in verifying expression ( The expression was verified successful, but no records were returned). I couldn't find a solution.


You need to use the "Add Join" tool. This will join the table data to the feature class.

By using the "KEEP_ALL" option, this will perform the outer join you need.

Please make sure the names of the fields are matched with the featureclass and table names correctly below (ie. in the "add join" part of the script). If not, please edit so that the join is performed correctly.

import arcpy, os
arcpy.env.workspace = r"path/to/gdb"
fc = r"path/to/featureclass"
table = r"path/to/table"
arcpy.MakeFeatureLayer_management(fc, "fc_layer")
arcpy.AddJoin_management("fc_layer", "MAHALLE_AD", table, "Mahalle", "KEEP_ALL")
arcpy.CopyFeatures_management("fc_layer", "New_Dataset")
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.