<?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: Using cx_Oracle SQL Query and writing the result to a non-spatial feature class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521968#M40919</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;STRONG&gt;Is there a way I can convert the SQL query directly into a File GDB feature class?&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;About the closest one can get to using an SQL query directly as a layer in ArcGIS is through &lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-query-layer.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-query-layer.htm"&gt;Make Query Layer—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;.&amp;nbsp; Since you are using an enterprise database, i.e., Oracle, you could create a query layer using your SQL and then use that layer as input to another tool to copy the data to a feature class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jan 2019 18:09:22 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2019-01-04T18:09:22Z</dc:date>
    <item>
      <title>Using cx_Oracle SQL Query and writing the result to a non-spatial feature class</title>
      <link>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521966#M40917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Python experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Python and cx_Oracle, I would like to query an Oracle SDE table (50 columns) and write the resulting data rows into a non-spatial File GDB feature class. Eventually, I will use this feature class and UpdateCursor&amp;nbsp; to update custom fields in a mosaic dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way I can convert the SQL query directly into a File GDB feature class?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying the numpy method (field mapping the 50 columns is going to be fun!) ,&amp;nbsp;I converted the query results to a numpy array and then wrote them to a feature class but the date fields get converted to datetime fields. I need dates only and I want to get it right before I proceed further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's&amp;nbsp;the code I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; numpy &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; np
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; cx_Oracle
out_tbl &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\Temp\work.gdb\img_source_qry'&lt;/SPAN&gt;
connstr&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'username/password@port/service'&lt;/SPAN&gt;
con &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cx_Oracle&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;connect&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;connstr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
curs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; con&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;cursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

sqlQry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"""
SELECT n_frame, t_available, d_flying
FROM db.table
where ROWNUM &amp;lt; 10
"""&lt;/SPAN&gt;

curs&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;execute&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sqlQry&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
datArray &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
cxRows &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; curs&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;fetchall&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; cxRow &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cxRows&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; datArray&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;cxRow&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# delete output feature class if it exists&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_tbl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Delete_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_tbl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#define array and write fc&lt;/SPAN&gt;
numpyarr_out &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datArray&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dtype&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Frame'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'&amp;lt;f8'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Available'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'S2'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Date_Fly'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'M8[us]'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NumPyArrayToTable&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;numpyarr_out&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_tbl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;#close the connections&lt;/SPAN&gt;
curs&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;close&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cxRows&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; curs
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; datArray
con&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;close&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the output, I am getting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="432526" alt="screenshot of a feature class table" class="image-1 jive-image j-img-original" src="/legacyfs/online/432526_2019-01-04 15_18_35-Window.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your advice. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:46:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521966#M40917</guid>
      <dc:creator>Thiru_P</dc:creator>
      <dc:date>2021-12-11T22:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using cx_Oracle SQL Query and writing the result to a non-spatial feature class</title>
      <link>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521967#M40918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you are specifying microseconds as the datetime format is that what you want?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# ---- changing the specifier in datetime64&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# day&lt;/SPAN&gt;
np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01-01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-02'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01-03'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-04'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dtype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'datetime64&lt;D&gt;'&lt;/D&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01-01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-02'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-03'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-04'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dtype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'datetime64&lt;D&gt;'&lt;/D&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# month&lt;/SPAN&gt;
np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01-01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-02'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01-03'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-04'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dtype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'datetime64&lt;M&gt;'&lt;/M&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dtype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'datetime64&lt;M&gt;'&lt;/M&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# microsecond&lt;/SPAN&gt;
np&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01-01'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-02'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01-03'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-04'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dtype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'datetime64[us]'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'2019-01-01T00:00:00.000000'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-02T00:00:00.000000'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;'2019-01-03T00:00:00.000000'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'2019-01-04T00:00:00.000000'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dtype&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'datetime64[us]'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;other info in numpy/scipy help&amp;nbsp;&lt;A class="link-titled" href="https://www.numpy.org/devdocs/reference/arrays.datetime.html" title="https://www.numpy.org/devdocs/reference/arrays.datetime.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Datetimes and Timedeltas — NumPy v1.17.dev0 Manual&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:46:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521967#M40918</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T22:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using cx_Oracle SQL Query and writing the result to a non-spatial feature class</title>
      <link>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521968#M40919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;STRONG&gt;Is there a way I can convert the SQL query directly into a File GDB feature class?&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;About the closest one can get to using an SQL query directly as a layer in ArcGIS is through &lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-query-layer.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-query-layer.htm"&gt;Make Query Layer—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;.&amp;nbsp; Since you are using an enterprise database, i.e., Oracle, you could create a query layer using your SQL and then use that layer as input to another tool to copy the data to a feature class.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2019 18:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521968#M40919</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-04T18:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using cx_Oracle SQL Query and writing the result to a non-spatial feature class</title>
      <link>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521969#M40920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dan. I want the date DD/MM/YYYY only. Is there a dtype specifically available for that?&lt;/P&gt;&lt;P&gt;My Oracle field is datetime.&amp;nbsp;When I try any other type, I get the following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Working\Scripts\ConnectOracle.py", line 127, in &amp;lt;module&amp;gt;&lt;BR /&gt; numpyarr_out = np.array(datArray, np.dtype([('Frame','&amp;lt;f8'), ('Available', 'S2'), ('Date_Fly', 'datetime64&lt;D&gt;')]))&lt;BR /&gt;TypeError: Cannot cast datetime.datetime object from metadata [us] to &lt;D&gt; according to the rule 'same_kind'&lt;/D&gt;&lt;/D&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Possibly, I could truncate the datetime field in the SQL query and store it in a string in numpy and convert it into date field again. Seems like a long detour.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2019 01:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521969#M40920</guid>
      <dc:creator>Thiru_P</dc:creator>
      <dc:date>2019-01-09T01:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using cx_Oracle SQL Query and writing the result to a non-spatial feature class</title>
      <link>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521970#M40921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;numpy was just a convenient example.&lt;/P&gt;&lt;P&gt;it is your use of 'us' … you are specifying a microsecond datetime.&lt;/P&gt;&lt;P&gt;You can probably do the sql format thing and get it in the format used in the U.S. (on a side note... you aren't confusing 'us' with US are you?, since US … the country... uses the DD/MM/YYYY format, like feet … metres and YYYY/MM/DD etc are international)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2019 02:22:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521970#M40921</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-09T02:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using cx_Oracle SQL Query and writing the result to a non-spatial feature class</title>
      <link>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521971#M40922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I point out the following not to nitpick but to educate.&amp;nbsp; The phrase "non-spatial File GDB feature class" contradicts itself.&amp;nbsp; By definition, a feature class is spatial.&amp;nbsp; A feature class doesn't have to actually have any geometry data stored in it, but the schema has to have a geometry column.&amp;nbsp; A file geodatabase table does not contain a geometry column, so it is non-spatial (non-spatial in the sense it isn't natively spatial, one can still store geometry information as text or blob in a table but ArcGIS won't treat it directly as spatial).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In terms of file geodatabase data types, according to &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/design-data-types-in-the-dbms.htm" title="http://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/design-data-types-in-the-dbms.htm"&gt;Data types in the DBMS—ArcGIS Help | ArcGIS Desktop&lt;/A&gt; :&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;File geodatabase data types are the same as ArcGIS data types. For DBMS products, though, data types can differ.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When looking at &lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/arcgis-field-data-types.htm#GUID-6F9BA736-430A-4CBD-990A-AA4C5E91FAB6" title="http://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/arcgis-field-data-types.htm#GUID-6F9BA736-430A-4CBD-990A-AA4C5E91FAB6"&gt;ArcGIS field data types—ArcGIS Help | ArcGIS Desktop&lt;/A&gt;, there is only one date data type:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;The date data type can store dates, times, or dates and times. The default format in which the information is presented is mm/dd/yyyy hh:mm:ss and a specification of AM or PM. When you enter date fields in the table through ArcGIS, they are converted to this format.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no way to just store a date and not time in an ArcGIS date field.&amp;nbsp; That said, Esri software commonly only displays the date if the time is set to 00:00:00.&amp;nbsp; If you only want people to see the date when opening a table in Esri software, change the time and then insert the records into a file geodatabase table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with Dan, use SQL date formatting to drop the time before inserting it into a file geodatabase.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2019 14:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-cx-oracle-sql-query-and-writing-the-result/m-p/521971#M40922</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-09T14:42:51Z</dc:date>
    </item>
  </channel>
</rss>

