<?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 Re: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390449#M30860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I print ticket_sql here is what is returned. &amp;nbsp;Is the CONVERT function incorrect for Oracle? &amp;nbsp;When I run this statement with the SQL Server table, it is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select jobid from SEU_GIS_GAS.actionaudit where actiondtdate &amp;gt;= '2017-01-17' and CONVERT(time,actiondttime) &amp;gt; '14:28:55' and jobid NOT LIKE '%ZZ%' &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Jan 2017 00:01:44 GMT</pubDate>
    <dc:creator>GeoffreyWest</dc:creator>
    <dc:date>2017-01-21T00:01:44Z</dc:date>
    <item>
      <title>ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390447#M30858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a Python script that has thrown this error. &amp;nbsp;The script has remained functional and working properly until I have changed the paths of the data that is being read in it. &amp;nbsp;Initially the application read 3 different tables which were all in a SQL Server DB. &amp;nbsp;I made a very small subset of each table(3 records) and exported these tables to an Oracle DB, when I am reading the data from the Oracle environment this error is thrown. &amp;nbsp;Here is where I make my ArcSDESQLExecute connection. What is the solution for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ticket_sql = "select {0} from {1} where {2} &amp;gt;= '{3}' and CONVERT(time, {4}) &amp;gt; '{5}' and jobid NOT LIKE '%ZZ%' ".format(self.ticket_id_field, self.ticket_audit_table_name, self.modified_date_field, last_date, self.modified_time_field, last_time)&lt;BR /&gt; self.logger.debug(ticket_sql)&lt;/P&gt;&lt;P&gt;conn = arcpy.ArcSDESQLExecute(self.korterra_sde_path)&lt;BR /&gt; results = conn.execute(ticket_sql)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 22:55:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390447#M30858</guid>
      <dc:creator>GeoffreyWest</dc:creator>
      <dc:date>2017-01-20T22:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390448#M30859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you print ticket_sql with the formatted text, does that SQL run in Oracle? I've noticed this error happening on occasion when there is an error in the text string.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 23:08:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390448#M30859</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2017-01-20T23:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390449#M30860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I print ticket_sql here is what is returned. &amp;nbsp;Is the CONVERT function incorrect for Oracle? &amp;nbsp;When I run this statement with the SQL Server table, it is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select jobid from SEU_GIS_GAS.actionaudit where actiondtdate &amp;gt;= '2017-01-17' and CONVERT(time,actiondttime) &amp;gt; '14:28:55' and jobid NOT LIKE '%ZZ%' &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 00:01:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390449#M30860</guid>
      <dc:creator>GeoffreyWest</dc:creator>
      <dc:date>2017-01-21T00:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390450#M30861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Geoffrey, what is your goal of the convert? Your inputs look like your inputting two field names, based on the SQL above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oracle uses convert character strings from one character set to another.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions027.htm#SQLRF00620" title="https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions027.htm#SQLRF00620"&gt;CONVERT&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 00:07:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390450#M30861</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2017-01-21T00:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390451#M30862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CONVERT in the above statements converts from a string to TIME field from the SQL table.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 00:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390451#M30862</guid>
      <dc:creator>GeoffreyWest</dc:creator>
      <dc:date>2017-01-21T00:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390452#M30863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So if we are sending this to Oracle and we need to change the string to a time field, then CONVERT cannot be used.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead for Oracle, we must use CAST or a TO_TIMESTAMP function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you clarify what "time" and "actiondttime" datatypes are in Oracle? In addition, which field are you attempting to convert, time or actiondttime?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 00:22:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390452#M30863</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2017-01-21T00:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390453#M30864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"actiondttime" is a string in oracle, the value time above was used in the SQL expression to note to convert a SQL table field from string to time.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 00:33:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390453#M30864</guid>
      <dc:creator>GeoffreyWest</dc:creator>
      <dc:date>2017-01-21T00:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: ArcSDESQLExecute: StreamPrepareSQL ArcSDE Error -38/SQL to Oracle?</title>
      <link>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390454#M30865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just for reference, in case you hadn't looked up the codes already:&amp;nbsp; &lt;A href="http://help.arcgis.com/en/geodatabase/10.0/sdk/arcsde/api/capi/returncodes_incl.htm"&gt;Return codes&lt;/A&gt;.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;H5 style="color: #000000; text-transform: none; text-indent: 0px; letter-spacing: normal; font-family: verdana; font-style: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px;"&gt;SE_ATTR_NOEXIST (-38)&lt;/H5&gt;&lt;P&gt;Returned from functions that attempt to access a column that does not exist. Sometimes returned after misspelling the name of the column.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jan 2017 14:58:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcsdesqlexecute-streampreparesql-arcsde-error-38/m-p/390454#M30865</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-01-21T14:58:59Z</dc:date>
    </item>
  </channel>
</rss>

