Creating cursor inside or outside loop

412
3
10-14-2019 03:45 AM
leonoestergaard
New Contributor III

Hi

 Here is my issue

If I create an insert cursor outside a for loop all inserted rows ends up with the same shape.

If I create the cursor inside the for loop i end up with the result that i expected

Sorry for code in image files, however this community editor seems to kill my indends

The first example the cursor is created outside the loop

 The result:

If i move the creation of the cursor inside the loop 

The result:

Why am I getting diffrent results? 

Tags (1)
0 Kudos
3 Replies
JoshuaBixby
MVP Esteemed Contributor

How many items are in nogleboksDict?  And, how are you selecting the records in your screenshots?

0 Kudos
DanPatterson_Retired
MVP Emeritus
0 Kudos
leonoestergaard
New Contributor III

Joshua Bixby‌  178 items in the dictionary. Im using "select by attributes" and querying with at like on a text field

0 Kudos