I am creating a tool that will allow a user to upload a csv file into our Oracle/SDE database. Not sure what changed from yesterday to today but now this script is working, it successfully inserted the record. Here is the code,
import arcpy, csv
from arcpy import env
#### parameters
inCSV = "C:\\Temp\\test.csv"
#### connect to sde database
env.workspace = "\\\\egis\\GeoTools\\System\\cw_em_load.sde"
copfc = "EM.COPIncident_P"
#### parse and convert csv to list, create point the prepare attributes
opencsv = open(inCSV, 'rt')
csvlist = csv.reader(opencsv)
for row in csvlist:
pnt = arcpy.Point()
pnt.Y = float(row[7])
pnt.X = float(row[8])
inctype = row[0]
#### create insert cursor and insert feature
cur = arcpy.InsertCursor(copfc,"\\\\egis\\GeoTools\\System\\WGS 1984.prj")
sdrow = cur.newRow()
sdrow.SHAPE = pnt
sdrow.INCIDENTTYPE = inctype
cur.insertRow(sdrow)
#### cleanup
opencsv.close()
del sdrow, cur, pnt