0

Using Arc 10.3.1 ModelBuilder, I need to populate a .dbf field (pfo_pct) with a variable value using the Calculate Field tool. However, the .dbf is an empty table (no records) and I get a Warning 000405: No records within table. The same problem happens outside of ModelBuilder when I try to Field Calculate on an empty table.

I believe that the problem could be resolved if I could insert an empty record into the .dbf prior to the field calculation, but I don't see any tools that accomplish that, nor any environment settings that would help.

Sadly, I am not proficient with Python...

closed as unclear what you're asking by Vince, Mapperz Jan 24 '17 at 1:16

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    What is the tool supposed to do? Is it a single value, or is it calculated for each geometry/shape/object in an existing attribute table? If you can't add it to the existing table (after adding a new field), you're going have to populate the new table with however many rows you need before performing the calculation. – mkennedy Jan 23 '17 at 23:19
  • The way I would add a row to an empty table is by using arcpy.da.InsertCursor. – PolyGeo Jan 23 '17 at 23:29
  • This really doesn't make any sense. You can't UPDATE a field value in an empty table -- because it's empty. Is this dBase table associated with a shapefile? – Vince Jan 23 '17 at 23:36
  • @Vince You are correct - the table is empty. As I mentioned in the OP, the problem would be solved if I could insert a row in the table, and that was the essence of my question. It appears that PolyGeo has that answer. – user45726 Jan 23 '17 at 23:48
1

The way I would add a row to an empty table is by using arcpy.da.InsertCursor.

Alternatively, keep a one row table somewhere so that you can Copy it, and then use the Calculate Field tool to update its one row.

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