<?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: Select  an JSONB column in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/select-an-jsonb-column/m-p/1549476#M73044</link>
    <description>&lt;P data-unlink="true"&gt;According to &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-postgresql/data-types-postgresql.htm" target="_self"&gt;these docs&lt;/A&gt;, JSONB is not supported. VARCHAR(0) and VARCHAR both are read as CLOB type. I'm not sure why it was failing with VARCHAR though as CLOB should be able to store an arbitrary amount of text data.&lt;/P&gt;&lt;P data-unlink="true"&gt;If you do want to use JSONB, you could try using a different SQL module like sqlalchemy or psychopg2 to pull the data from the PostGIS database in the script, unless you need the whole schema to be fully compatible with Esri apis.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2024 13:40:17 GMT</pubDate>
    <dc:creator>HaydenWelch</dc:creator>
    <dc:date>2024-10-17T13:40:17Z</dc:date>
    <item>
      <title>Select  an JSONB column</title>
      <link>https://community.esri.com/t5/python-questions/select-an-jsonb-column/m-p/1544362#M72969</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; In a geoprocessing toolbox, I want to select an attribute containing a JSON, with the following code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"select jbdata from &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;table_jsonbdata&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;tmp&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;egdb_conn&lt;/SPAN&gt;&lt;SPAN&gt;.execute(&lt;/SPAN&gt;&lt;SPAN&gt;sql&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I obtain this error&lt;/P&gt;&lt;P&gt;fail Exception : ArcSDESQLExecute: StreamBindOutputColumn Erreur ArcSDE -65 Invalid pointer argument to function&lt;/P&gt;&lt;P&gt;Exception : File "C:\Users\User01\Desktop\GestionDeProjet\Script-BDD\uploadBackpack.py", line 781, in main&lt;BR /&gt;tmp = egdb_conn.execute(sql)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with JSONB : it failed&lt;/P&gt;&lt;P&gt;I tried with TEXT : it failed&lt;/P&gt;&lt;P&gt;I tried with VARCHAR : it failed&lt;/P&gt;&lt;P&gt;I tried with VARCHAR(2048) : it works&lt;/P&gt;&lt;P&gt;How should I store my json in the postgresql table in order to be able to selectit in a geoprocessing script ?&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 16:12:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-an-jsonb-column/m-p/1544362#M72969</guid>
      <dc:creator>xavierlhomme</dc:creator>
      <dc:date>2024-10-01T16:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select  an JSONB column</title>
      <link>https://community.esri.com/t5/python-questions/select-an-jsonb-column/m-p/1549476#M73044</link>
      <description>&lt;P data-unlink="true"&gt;According to &lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-postgresql/data-types-postgresql.htm" target="_self"&gt;these docs&lt;/A&gt;, JSONB is not supported. VARCHAR(0) and VARCHAR both are read as CLOB type. I'm not sure why it was failing with VARCHAR though as CLOB should be able to store an arbitrary amount of text data.&lt;/P&gt;&lt;P data-unlink="true"&gt;If you do want to use JSONB, you could try using a different SQL module like sqlalchemy or psychopg2 to pull the data from the PostGIS database in the script, unless you need the whole schema to be fully compatible with Esri apis.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2024 13:40:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-an-jsonb-column/m-p/1549476#M73044</guid>
      <dc:creator>HaydenWelch</dc:creator>
      <dc:date>2024-10-17T13:40:17Z</dc:date>
    </item>
  </channel>
</rss>

