<?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: Update a table using a subquery in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Update-a-table-using-a-subquery/m-p/834800#M329998</link>
    <description>&lt;P&gt;Since you whole code executes in SQL Server, this issue should be directed to a SQL Server forum instead.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 07:47:20 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2022-09-23T07:47:20Z</dc:date>
    <item>
      <title>Update a table using a subquery</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-a-table-using-a-subquery/m-p/834798#M329997</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I try to update a table form a database:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EXECUTE(&lt;BR /&gt;UPDATE ##TB_HIST&lt;BR /&gt;SET KEY=(SELECT DISTINCT KEY FROM TB_DEMO WHERE KEY =P_KEY ),&lt;BR /&gt;ID=(SELECT ID FROM TB__DEMO WHERE KEY =P_KEY)&lt;BR /&gt;WHERE UPPER(TYPE_TX)='Disney' &lt;BR /&gt;) BY SQLSERVER;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the error :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: CLI execute error:&amp;nbsp;&lt;SPAN&gt;Subquery returned more than 1 value” and that “This is not permitted when the subquery follows =, !=, &amp;lt;, &amp;lt;= , &amp;gt;, &amp;gt;= or when the subquery is used as an expression”.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kindly advise.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 07:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-a-table-using-a-subquery/m-p/834798#M329997</guid>
      <dc:creator>sarahzhou</dc:creator>
      <dc:date>2022-09-23T07:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Update a table using a subquery</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Update-a-table-using-a-subquery/m-p/834800#M329998</link>
      <description>&lt;P&gt;Since you whole code executes in SQL Server, this issue should be directed to a SQL Server forum instead.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 07:47:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Update-a-table-using-a-subquery/m-p/834800#M329998</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-09-23T07:47:20Z</dc:date>
    </item>
  </channel>
</rss>

