<?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: Insert on existing update from select in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/insert-on-existing-update-from-select/qaa-p/13824949#M4855792</link>
    <description>&lt;P&gt;FWIW, the correct error text shoud be "Remote server does not have the ability to support this statement" (SQLCODE -706).&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 12:11:43 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2020-12-10T12:11:43Z</dc:date>
    <item>
      <title>Insert on existing update from select</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-on-existing-update-from-select/qaq-p/13824947</link>
      <description>&lt;P&gt;Hi felows,&lt;/P&gt;
&lt;P&gt;I Have a script, collecting data from several tables, it takes long time to run, I created a single table that have just the information I need, I want to create a procedure, to run every day (with cron), to update this table.&lt;BR /&gt;
This way above, works, I tested:&lt;BR /&gt;
&lt;B&gt;"insert into new_table (var1, var2,var3...) select var1, var2, var3... from other_table where..."&lt;/B&gt;&lt;BR /&gt;
but I tried to do this using &lt;B&gt;"on existing update"&lt;/B&gt; and the ISQL give me the error.
&lt;B&gt;"Remote server does not the ability to support this statement"&lt;/B&gt;&lt;BR /&gt;
I couldn't find anything related on forums or Sybase KB.&lt;BR /&gt;
There is some way to do what I want ?&lt;BR /&gt;
Thanks a lot&lt;BR /&gt;
Paulo Braga - Brazil&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 08:06:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-on-existing-update-from-select/qaq-p/13824947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-12-10T08:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Insert on existing update from select</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-on-existing-update-from-select/qaa-p/13824948#M4855791</link>
      <description>&lt;P&gt;AFAIK, the ON EXISTING clause does not work when the source table (SELECT FROM) or the destination table (INSERT INTO) are proxy tables, as documented &lt;A href="http://dcx.sap.com/index.html#sqla170/en/html/81712f3a6ce21014ada883e2b235cf26.html"&gt;here&lt;/A&gt; - although the documentation just mentions the destination table.&lt;/P&gt;
&lt;P&gt;My typical workaround is a two-step approach:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;SELECT the proxy's table relevant contents into a local temporary table (so via the &lt;A href="http://dcx.sap.com/index.html#sqla170/en/html/3be640936c5f10149013d54460eaabb0.html"&gt;SELECT ... INTO LOCAL TEMPORARY TABLE... syntax&lt;/A&gt;)&lt;/LI&gt;
&lt;LI&gt;Use your original INSERT ... ON UPDATE... SELECT FROM LT..., i.e. selecting from the local temporary table from step 1. As the local temporary table and the destination table are both local, the ON UPDATE clause should work.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 10 Dec 2020 11:35:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-on-existing-update-from-select/qaa-p/13824948#M4855791</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-12-10T11:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Insert on existing update from select</title>
      <link>https://community.sap.com/t5/technology-q-a/insert-on-existing-update-from-select/qaa-p/13824949#M4855792</link>
      <description>&lt;P&gt;FWIW, the correct error text shoud be "Remote server does not have the ability to support this statement" (SQLCODE -706).&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 12:11:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/insert-on-existing-update-from-select/qaa-p/13824949#M4855792</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-12-10T12:11:43Z</dc:date>
    </item>
  </channel>
</rss>

