<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ArcSDESQLExecture error -202 illegal character in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcsdesqlexecture-error-202-illegal-character/m-p/106050#M8169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to retrieve data from a remotely stored sde using sql given the suggestion that it may be faster than using copy features and other arcpy functions (3 gb feature class was taking 4+ hours to transfer over to a feature class in an empty fileGDB). I have tried the following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;db = r"Q:\SDE\Direct Connection to remote.sde"&lt;BR /&gt;egdb_conn = arcpy.ArcSDESQLExecute(db)&lt;/P&gt;&lt;P&gt;table_name = 'Topography\Contour'&lt;/P&gt;&lt;P&gt;sql = '''&lt;BR /&gt;SELECT load_date FROM {0}&lt;BR /&gt;'''.format(table_name)&lt;/P&gt;&lt;P&gt;egdb_return = egdb_conn.execute(sql)&lt;BR /&gt;for i in egdb_return:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;print('{}: {}'.format(*i))&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;When I run the code, I come across the following error&lt;/P&gt;&lt;P&gt;AttributeError: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Extended error -202 [Informix][Informix ODBC Driver][Informix]An illegal character has been found in the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sql statement is shown as&amp;nbsp;'\nSELECT load_date FROM delivery:eicu.Topography\\delivery:eicu.Contour_Other\n'&lt;/P&gt;&lt;P&gt;What would be the issue?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Apr 2019 22:35:49 GMT</pubDate>
    <dc:creator>AndyCho</dc:creator>
    <dc:date>2019-04-03T22:35:49Z</dc:date>
    <item>
      <title>ArcSDESQLExecture error -202 illegal character</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecture-error-202-illegal-character/m-p/106050#M8169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to retrieve data from a remotely stored sde using sql given the suggestion that it may be faster than using copy features and other arcpy functions (3 gb feature class was taking 4+ hours to transfer over to a feature class in an empty fileGDB). I have tried the following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;db = r"Q:\SDE\Direct Connection to remote.sde"&lt;BR /&gt;egdb_conn = arcpy.ArcSDESQLExecute(db)&lt;/P&gt;&lt;P&gt;table_name = 'Topography\Contour'&lt;/P&gt;&lt;P&gt;sql = '''&lt;BR /&gt;SELECT load_date FROM {0}&lt;BR /&gt;'''.format(table_name)&lt;/P&gt;&lt;P&gt;egdb_return = egdb_conn.execute(sql)&lt;BR /&gt;for i in egdb_return:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;print('{}: {}'.format(*i))&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;When I run the code, I come across the following error&lt;/P&gt;&lt;P&gt;AttributeError: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Extended error -202 [Informix][Informix ODBC Driver][Informix]An illegal character has been found in the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sql statement is shown as&amp;nbsp;'\nSELECT load_date FROM delivery:eicu.Topography\\delivery:eicu.Contour_Other\n'&lt;/P&gt;&lt;P&gt;What would be the issue?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2019 22:35:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecture-error-202-illegal-character/m-p/106050#M8169</guid>
      <dc:creator>AndyCho</dc:creator>
      <dc:date>2019-04-03T22:35:49Z</dc:date>
    </item>
  </channel>
</rss>

