Invalid Primary Key error message when attempting to join table view and feature layerArcpy error message:...

If I delete my router's history can my ISP still provide it to my parents?

Can a hotel cancel a confirmed reservation?

Avoiding morning and evening handshakes

How to acknowledge an embarrassing job interview, now that I work directly with the interviewer?

Do authors have to be politically correct in article-writing?

Why don't I see the difference between two different files in insert mode in vim?

Why would the Pakistan airspace closure cancel flights not headed to Pakistan itself?

Recrystallisation of dibenzylideneacetone

Does my logo design convey the right feelings for a University Student's Council?

Is it safe to try charging my laptop with a USB-C PD charger that has less wattage than recommended?

How can I deal with a significant flaw I found in my previous supervisor’s paper?

Does the "particle exchange" operator have any validity?

Manipulating a general length function

Is there hidden data in this .blend file? Trying to minimize the file size

What is the purpose of easy combat scenarios that don't need resource expenditure?

What do you call a fact that doesn't match the settings?

Strange Sign on Lab Door

Getting a UK passport renewed when you have dual nationality and a different name in your second country?

What is better: yes / no radio, or simple checkbox?

Can I become debt free or should I file for bankruptcy? How do I manage my debt and finances?

Program that converts a number to a letter of the alphabet

The vanishing of sum of coefficients: symmetric polynomials

How to generate a matrix with certain conditions

What is the time complexity of enqueue and dequeue of a queue implemented with a singly linked list?



Invalid Primary Key error message when attempting to join table view and feature layer


Arcpy error message: 'Layer' object is not subscriptable?AddJoin failing in Python ArcGISMeaning of Spatial Join ERROR 000840: The value is not a Feature Layer?arcpy join csv files to raster attribute tableHow do you filter a layer on a joined table in QGIS?Copy query feature layer into a feature class - error 000732Arcpy: Update cursor updating both layer file and feature calssArcpy.AddJoin errorUsing ArcPy to join feature class to Oracle Spatial View?arcpy Add Join with “KEEP_ALL” Does not Keep All













0















I am attempting to join a feature layer to a table view in order to export a table of all non-joining features in the table view by selecting NULLS from the join field related to the feature layer. When I attempt using AddJoin to accomplish this I am met with the following error.




ERROR: 999999: Error executing function. The layer has an invalid
primary key




I have used AddJoin to join these two datasets earlier in my script successfully, but that was joining the Table View to the Feature Layer, not the other way around. Please see below for more details and code.



I create the Table View and confirm it exists with this bit of code:



for file in gdb_files:
print("EDes table available: {}".format(file))
if 'GIS' in file:
print("Creating Table View for EDes file")
arcpy.MakeTableView_management(os.path.join(gdb_path, file), "EDES_TableView")
print(arcpy.Exists("EDES_TableView"))


I create the Feature Layers and confirm they exists with this bit of code:



arcpy.MakeFeatureLayer_management(os.path.join(gdb_path, "Some_SDE_FC"), "Some_F_Layer")
arcpy.MakeFeatureLayer_management(os.path.join(gdb_path, "Some_SDE_FC_2"), "Some_F_Layer_2")

print(arcpy.Exists("Some_F_Layer"))
print(arcpy.Exists("Some_F_Layer_2"))


I am able to join a table view and feature layer successfully prior to the error message with this bit of code:



arcpy.env.workspace = gdb_path
arcpy.AddJoin_management("Some_F_Layer", "BBL", "EDES_TableView", "BBL", "KEEP_ALL")
arcpy.CopyFeatures_management("Some_F_Layer", "Match")


But when I attempt to rejoin the same Table View and Feature Layer, but in the opposite order, I get the above mentioned error. See code bit below:



arcpy.AddJoin_management("EDES_TableView", "BBL", "Some_F_Layer", "BBL", "KEEP_ALL")









share|improve this question














bumped to the homepage by Community 13 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I am attempting to join a feature layer to a table view in order to export a table of all non-joining features in the table view by selecting NULLS from the join field related to the feature layer. When I attempt using AddJoin to accomplish this I am met with the following error.




    ERROR: 999999: Error executing function. The layer has an invalid
    primary key




    I have used AddJoin to join these two datasets earlier in my script successfully, but that was joining the Table View to the Feature Layer, not the other way around. Please see below for more details and code.



    I create the Table View and confirm it exists with this bit of code:



    for file in gdb_files:
    print("EDes table available: {}".format(file))
    if 'GIS' in file:
    print("Creating Table View for EDes file")
    arcpy.MakeTableView_management(os.path.join(gdb_path, file), "EDES_TableView")
    print(arcpy.Exists("EDES_TableView"))


    I create the Feature Layers and confirm they exists with this bit of code:



    arcpy.MakeFeatureLayer_management(os.path.join(gdb_path, "Some_SDE_FC"), "Some_F_Layer")
    arcpy.MakeFeatureLayer_management(os.path.join(gdb_path, "Some_SDE_FC_2"), "Some_F_Layer_2")

    print(arcpy.Exists("Some_F_Layer"))
    print(arcpy.Exists("Some_F_Layer_2"))


    I am able to join a table view and feature layer successfully prior to the error message with this bit of code:



    arcpy.env.workspace = gdb_path
    arcpy.AddJoin_management("Some_F_Layer", "BBL", "EDES_TableView", "BBL", "KEEP_ALL")
    arcpy.CopyFeatures_management("Some_F_Layer", "Match")


    But when I attempt to rejoin the same Table View and Feature Layer, but in the opposite order, I get the above mentioned error. See code bit below:



    arcpy.AddJoin_management("EDES_TableView", "BBL", "Some_F_Layer", "BBL", "KEEP_ALL")









    share|improve this question














    bumped to the homepage by Community 13 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I am attempting to join a feature layer to a table view in order to export a table of all non-joining features in the table view by selecting NULLS from the join field related to the feature layer. When I attempt using AddJoin to accomplish this I am met with the following error.




      ERROR: 999999: Error executing function. The layer has an invalid
      primary key




      I have used AddJoin to join these two datasets earlier in my script successfully, but that was joining the Table View to the Feature Layer, not the other way around. Please see below for more details and code.



      I create the Table View and confirm it exists with this bit of code:



      for file in gdb_files:
      print("EDes table available: {}".format(file))
      if 'GIS' in file:
      print("Creating Table View for EDes file")
      arcpy.MakeTableView_management(os.path.join(gdb_path, file), "EDES_TableView")
      print(arcpy.Exists("EDES_TableView"))


      I create the Feature Layers and confirm they exists with this bit of code:



      arcpy.MakeFeatureLayer_management(os.path.join(gdb_path, "Some_SDE_FC"), "Some_F_Layer")
      arcpy.MakeFeatureLayer_management(os.path.join(gdb_path, "Some_SDE_FC_2"), "Some_F_Layer_2")

      print(arcpy.Exists("Some_F_Layer"))
      print(arcpy.Exists("Some_F_Layer_2"))


      I am able to join a table view and feature layer successfully prior to the error message with this bit of code:



      arcpy.env.workspace = gdb_path
      arcpy.AddJoin_management("Some_F_Layer", "BBL", "EDES_TableView", "BBL", "KEEP_ALL")
      arcpy.CopyFeatures_management("Some_F_Layer", "Match")


      But when I attempt to rejoin the same Table View and Feature Layer, but in the opposite order, I get the above mentioned error. See code bit below:



      arcpy.AddJoin_management("EDES_TableView", "BBL", "Some_F_Layer", "BBL", "KEEP_ALL")









      share|improve this question














      I am attempting to join a feature layer to a table view in order to export a table of all non-joining features in the table view by selecting NULLS from the join field related to the feature layer. When I attempt using AddJoin to accomplish this I am met with the following error.




      ERROR: 999999: Error executing function. The layer has an invalid
      primary key




      I have used AddJoin to join these two datasets earlier in my script successfully, but that was joining the Table View to the Feature Layer, not the other way around. Please see below for more details and code.



      I create the Table View and confirm it exists with this bit of code:



      for file in gdb_files:
      print("EDes table available: {}".format(file))
      if 'GIS' in file:
      print("Creating Table View for EDes file")
      arcpy.MakeTableView_management(os.path.join(gdb_path, file), "EDES_TableView")
      print(arcpy.Exists("EDES_TableView"))


      I create the Feature Layers and confirm they exists with this bit of code:



      arcpy.MakeFeatureLayer_management(os.path.join(gdb_path, "Some_SDE_FC"), "Some_F_Layer")
      arcpy.MakeFeatureLayer_management(os.path.join(gdb_path, "Some_SDE_FC_2"), "Some_F_Layer_2")

      print(arcpy.Exists("Some_F_Layer"))
      print(arcpy.Exists("Some_F_Layer_2"))


      I am able to join a table view and feature layer successfully prior to the error message with this bit of code:



      arcpy.env.workspace = gdb_path
      arcpy.AddJoin_management("Some_F_Layer", "BBL", "EDES_TableView", "BBL", "KEEP_ALL")
      arcpy.CopyFeatures_management("Some_F_Layer", "Match")


      But when I attempt to rejoin the same Table View and Feature Layer, but in the opposite order, I get the above mentioned error. See code bit below:



      arcpy.AddJoin_management("EDES_TableView", "BBL", "Some_F_Layer", "BBL", "KEEP_ALL")






      arcpy attribute-joins table feature-layer






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 31 at 14:50









      CambrianCatalystCambrianCatalyst

      1437




      1437





      bumped to the homepage by Community 13 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 13 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          The issue was that I was trying to join back onto the table that I had already joined on previously. I needed to use Delete_management to remove the table view from memory, re-instantiate it from the same source, and perform the join again with the reversed datasets.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "79"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f310634%2finvalid-primary-key-error-message-when-attempting-to-join-table-view-and-feature%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The issue was that I was trying to join back onto the table that I had already joined on previously. I needed to use Delete_management to remove the table view from memory, re-instantiate it from the same source, and perform the join again with the reversed datasets.






            share|improve this answer




























              0














              The issue was that I was trying to join back onto the table that I had already joined on previously. I needed to use Delete_management to remove the table view from memory, re-instantiate it from the same source, and perform the join again with the reversed datasets.






              share|improve this answer


























                0












                0








                0







                The issue was that I was trying to join back onto the table that I had already joined on previously. I needed to use Delete_management to remove the table view from memory, re-instantiate it from the same source, and perform the join again with the reversed datasets.






                share|improve this answer













                The issue was that I was trying to join back onto the table that I had already joined on previously. I needed to use Delete_management to remove the table view from memory, re-instantiate it from the same source, and perform the join again with the reversed datasets.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 31 at 21:54









                CambrianCatalystCambrianCatalyst

                1437




                1437






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f310634%2finvalid-primary-key-error-message-when-attempting-to-join-table-view-and-feature%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

                    Щит и меч (фильм) Содержание Названия серий | Сюжет |...

                    Энтрерриос (город) Содержание История | Географическое...