I'm developing a script that creates a table adds fields and then populates the values of those fields. I'm good with creating the table and adding the fields, it's the insert cursor that's giving me grief. (Perhaps I'm giving the insert cursor grief; it's friday afternoon after all...)
Let's call the table newTable, I have list of the values for each of the fields in order:
<SPAN class="comment token"># the list values looks like this:</SPAN>
<SPAN class="punctuation token">[</SPAN><SPAN class="number token">101</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'Salt Lake County'</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'Jordan School District'</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'South Jordan City'</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'South Salt Lake Valley Mosquito Abatement District'</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'Jordan Valley Water Conservancy District'</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'Jordan/Canyons Debt Service Area'</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'Central Utah Water Conservancy District'</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'Crescent Cemetery District'</SPAN><SPAN class="punctuation token">,</SPAN> u<SPAN class="string token">'South Valley Sewer District'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
However, when I try to use the list as the source, it errors out with TypeError: sequence size must match size of the row.
I can see where the issue is: when I perform arcpy.ListFields(newTable) I get 11 fields. But, but the length of my list of values is 10: the difference being the objectid. I don't quite understand how to accommodate for the OID and the subsequent difference in row size vs the number of list elements.