AnsweredAssumed Answered

UnicodeEncodeError

Question asked by cliveswan on May 27, 2015
Latest reply on Jun 1, 2015 by HavardMoe

I cannot retrieve records for a Arc/Oracle database

I get an "UnicodeEncodeError: 'ascii' codec can't encode character" error

 

snippet of the code:

sdeConn = arcpy.ArcSDESQLExecute(sde_conn_file)

 

for tbl in tableList:

    try:

        userValue = "u'"

        val = ''.join([x for x in userValue if ord(x) < 128])

       

        sdeReturn = sdeConn.execute("SELECT * FROM DBA_OBJECTS"  )

 

The records are printed out as:

[u'GISADMIN.KCC_KHS_CUSTOMER_LKP', u'GISADMIN.KCC_KHS_DISTRICT_LKP']

 

I tried to use a CSV.writer - did nothing??

 

def writerows(self, rows):

        file = open(output_file, 'wb')

        for row in rows:

            print row

            self.writerow(row)

            file.close()

 

 

I would appreciate assistance to get the CSV.writer working...

 

Thanks,

 

Clive

Outcomes