<?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>Question Re: How to retrieve temporary table structure? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaa-p/13830861#M4861704</link>
    <description>&lt;P&gt;Nice, I just wanted to mentioned &lt;A href="https://sqlanywhere-forum.sap.com/questions/13021#13031"&gt;another answer&lt;/A&gt; - with exactly that solution.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2022 09:24:07 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2022-03-14T09:24:07Z</dc:date>
    <item>
      <title>How to retrieve temporary table structure?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaq-p/13830858</link>
      <description>&lt;P&gt;Title kind of says it all, here is a sample query:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;BEGIN
    DECLARE LOCAL TEMPORARY TABLE tmp(id INTEGER, val VARCHAR(20));
    SELECT * FROM sys.syscolumns WHERE tname = 'tmp';
END;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 08:14:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaq-p/13830858</guid>
      <dc:creator>Valdas</dc:creator>
      <dc:date>2022-03-14T08:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve temporary table structure?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaa-p/13830859#M4861702</link>
      <description>&lt;P&gt;AFAIK, you cannot, because by definition local temporary tables – in contrast to permanent tables and global temporary tables – are not contained in the system catalog.&lt;/P&gt;
&lt;P&gt;Catalog queries like in your sample or builtin functions like &lt;A href="https://dcx.sap.com/index.html#sqla170/en/html/8175d9a06ce21014ad5d9c17d6a9ab68.html"&gt;the sa_get_table_definition() system procedure&lt;/A&gt; rely on the system catalog to provide information, so they won't offer information for local temporary tables.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;FWIW, the &lt;A href="https://help.sap.com/viewer/93079d4ba8e44920ae63ffb4def91f5b/17.0.01/en-US/3bea93c06c5f1014a83df5f526a8a9d2.html"&gt;table SYSTAB itself&lt;/A&gt; specifies that the column "table_type" is set to 4 in case of a "Local temporary table", so my assumption might be wrong.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 08:56:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaa-p/13830859#M4861702</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2022-03-14T08:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve temporary table structure?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaa-p/13830860#M4861703</link>
      <description>&lt;P&gt;I found a workaround:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;BEGIN
    DECLARE LOCAL TEMPORARY TABLE tmp(id INTEGER, val VARCHAR(20));
    SELECT * FROM sa_describe_query('select * from tmp');
END;
&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Mar 2022 09:20:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaa-p/13830860#M4861703</guid>
      <dc:creator>Valdas</dc:creator>
      <dc:date>2022-03-14T09:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve temporary table structure?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaa-p/13830861#M4861704</link>
      <description>&lt;P&gt;Nice, I just wanted to mentioned &lt;A href="https://sqlanywhere-forum.sap.com/questions/13021#13031"&gt;another answer&lt;/A&gt; - with exactly that solution.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 09:24:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-retrieve-temporary-table-structure/qaa-p/13830861#M4861704</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2022-03-14T09:24:07Z</dc:date>
    </item>
  </channel>
</rss>

