Trying to add a value in the second row of a tableUsing Update Cursor?Insert cursor for first row in unique...

What is a good reason for every spaceship to carry a weapon on board?

Publishing research using outdated methods

What would be the rarity of this magic item(s)?

Early credit roll before the end of the film

How to change a n value for a value like X

How old is the day of 24 equal hours?

What are "industrial chops"?

Can we harness gravitational potential energy?

Absorbing damage with Planeswalker

Quickly creating a sparse array

Am I a Rude Number?

Can a person refuse a presidential pardon?

Non-Cancer terminal illness that can affect young (age 10-13) girls?

What would the chemical name be for C13H8Cl3NO

How should I handle players who ignore the session zero agreement?

Should I reinstall Linux when changing the laptop's CPU?

A Missing Symbol for This Logo

Is there a weight limit to Feather Fall?

What are career options for big-picture thinkers with no experience?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Construct transition probability matrix for markov chain

Why would space fleets be aligned?

What is the difference between rolling more dice versus fewer dice?

Why zero tolerance on nudity in space?



Trying to add a value in the second row of a table


Using Update Cursor?Insert cursor for first row in unique value set arcpyCalculate Row if Row Value Equals Value in ListGetting first and second row with ArcPy searchcursor?Zonal histogram script VALUE row suffix problemTrying to increment a field value for only the repeated records in a feature class using PythonWriting Data Driven Pages' scale into driving layer's attribute table with arcpyIteratively Updating Just Bottom Row in Table using ArcPy?ArcPy Cursor Where Clause to Delete Rows — why is if statement needed?Comparing value with value from the next row













0















I am trying to add a specific value to a cell of the second row of a feature-class-table. Doesn't work with my code:



    #First row
rows = arcpy.InsertCursor(tb_value)
row = rows.newRow()
rows.insertRow(row)

cur = arcpy.UpdateCursor(tb_value)
for row in cur:
row.setValue(fn_value_object, COUNTER)
row.setValue(fn_name_area, gebietsname)
row.setValue(fn_name_object, objektname)
cur.updateRow(row)

#Second row
whereClause = """{0} = 2"""
whereClause = whereClause.format(arcpy.AddFieldDelimiters(tb_value, "Rowid"))
cur = arcpy.UpdateCursor(tb_value, whereClause)
row = rows.newRow()
rows.insertRow(row)
for row in cur:
row.setValue(fn_value_object, COUNTER2)


I tried it with a where-clause, but the value which is set in the second row is 0.









share



























    0















    I am trying to add a specific value to a cell of the second row of a feature-class-table. Doesn't work with my code:



        #First row
    rows = arcpy.InsertCursor(tb_value)
    row = rows.newRow()
    rows.insertRow(row)

    cur = arcpy.UpdateCursor(tb_value)
    for row in cur:
    row.setValue(fn_value_object, COUNTER)
    row.setValue(fn_name_area, gebietsname)
    row.setValue(fn_name_object, objektname)
    cur.updateRow(row)

    #Second row
    whereClause = """{0} = 2"""
    whereClause = whereClause.format(arcpy.AddFieldDelimiters(tb_value, "Rowid"))
    cur = arcpy.UpdateCursor(tb_value, whereClause)
    row = rows.newRow()
    rows.insertRow(row)
    for row in cur:
    row.setValue(fn_value_object, COUNTER2)


    I tried it with a where-clause, but the value which is set in the second row is 0.









    share

























      0












      0








      0








      I am trying to add a specific value to a cell of the second row of a feature-class-table. Doesn't work with my code:



          #First row
      rows = arcpy.InsertCursor(tb_value)
      row = rows.newRow()
      rows.insertRow(row)

      cur = arcpy.UpdateCursor(tb_value)
      for row in cur:
      row.setValue(fn_value_object, COUNTER)
      row.setValue(fn_name_area, gebietsname)
      row.setValue(fn_name_object, objektname)
      cur.updateRow(row)

      #Second row
      whereClause = """{0} = 2"""
      whereClause = whereClause.format(arcpy.AddFieldDelimiters(tb_value, "Rowid"))
      cur = arcpy.UpdateCursor(tb_value, whereClause)
      row = rows.newRow()
      rows.insertRow(row)
      for row in cur:
      row.setValue(fn_value_object, COUNTER2)


      I tried it with a where-clause, but the value which is set in the second row is 0.









      share














      I am trying to add a specific value to a cell of the second row of a feature-class-table. Doesn't work with my code:



          #First row
      rows = arcpy.InsertCursor(tb_value)
      row = rows.newRow()
      rows.insertRow(row)

      cur = arcpy.UpdateCursor(tb_value)
      for row in cur:
      row.setValue(fn_value_object, COUNTER)
      row.setValue(fn_name_area, gebietsname)
      row.setValue(fn_name_object, objektname)
      cur.updateRow(row)

      #Second row
      whereClause = """{0} = 2"""
      whereClause = whereClause.format(arcpy.AddFieldDelimiters(tb_value, "Rowid"))
      cur = arcpy.UpdateCursor(tb_value, whereClause)
      row = rows.newRow()
      rows.insertRow(row)
      for row in cur:
      row.setValue(fn_value_object, COUNTER2)


      I tried it with a where-clause, but the value which is set in the second row is 0.







      arcpy cursor update where-clause





      share












      share










      share



      share










      asked 3 mins ago









      AndreasAndreas

      204




      204






















          0






          active

          oldest

          votes











          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%2f313856%2ftrying-to-add-a-value-in-the-second-row-of-a-table%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f313856%2ftrying-to-add-a-value-in-the-second-row-of-a-table%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

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

          Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

          Meter-Bus Содержание Параметры шины | Стандартизация |...