Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Why aren't my rows being inserted into the table?

$
0
0
I am attempting to insertRows into my new table from my existing table. It should be scrolling through the existing table and taking that value and placing it into the new table.

Code:

    #b. search the dissolved intersection layer
    irows = InsertCursor(street_tally)
    srows = SearchCursor(int_lay, '', '', '', 'COMPOSITE A')
    for srow in srows:
        name = srow.COMPOSITE
        sev = srow.severity
        if prev_name == name:
            tally += int(sev)
            #var = name
            #print name, tally
        else:
            tally = int(sev)
        #tally = int(sev)
        #print name, tally
        irow = irows.newRow()
        irow.AddID = counter
        irow.STREET = name
        irow.SEVERITY = tally
        irows.insertRow(irow)
        counter +=1
        prev_name = name

Thank you again for all your help.

Sincerely,

Bryce

Viewing all articles
Browse latest Browse all 2485

Trending Articles