AnsweredAssumed Answered

InsertCursor... using input paramter

Question asked by jamesfreddyc on Oct 5, 2012
Latest reply on Oct 5, 2012 by jamesfreddyc
ArcGIS 9.3.1
Python 2.5

Should be a simple thing but is causing me problems.  I have an input parameter from a Toolbox that runs some processing (InsertCuror on a FC).  It fails when I try to set the row.field = value, where the .field is the input parameter.

SampleType = gp.GetParameter(2)  insRows = gp.InsertCursor(tblNew) for cxRow in cursor.fetchall():       insRow = insRows.newRow()       insRow.SampleType = val_SampleType  <-- doesn't like .SampleType       insRows.insertRow(insRow)


I have tried a few variations with no success:

insRow. + SampleType = val_SampleType   insRow. + str(SampleType) = val_SampleType  insRow. + " " + str(SampleType) = val_SampleType   ...etc


Anyone able to set insRow.<some parameter value> = value correctly?

Outcomes