<?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 Insert rows based on matching values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Insert-rows-based-on-matching-values/m-p/641812#M191361</link>
    <description>&lt;P&gt;I'm trying to insert rows in base table (WANT) based on the matching values 'run_id', but it's throwing error if I try with the code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I missing something in the where clause? I want to insert rows in base table only run_id matches between base table (WANT)&amp;nbsp;and &amp;amp;tab.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql undo_policy=none;
Insert into IFR.WANT (table_name,table_count) 
select table_name,table_count from &amp;amp;tab where run_id in (select run_id from &amp;amp;tab);
quit;&lt;/PRE&gt;
&lt;PRE&gt;WARNING: The SQL option UNDO_POLICY=REQUIRED is not in effect. If an error is detected when processing this INSERT statement, that 
         error will not cause the entire statement to fail.
ERROR: CLI execute error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Cannot insert the value NULL into column 
       'RUN_ID', table 'IFR.WANT'; column does not allow nulls. INSERT fails. : [SAS][ODBC SQL Server Wire 
       Protocol driver][Microsoft SQL Server]The statement has been terminated.
NOTE: 1 row was inserted into IFR.WANT-- of these 1 row was rejected as an ERROR, leaving 0 rows that were inserted 
      successfully.&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Apr 2020 04:31:53 GMT</pubDate>
    <dc:creator>David_Billa</dc:creator>
    <dc:date>2020-04-22T04:31:53Z</dc:date>
    <item>
      <title>Insert rows based on matching values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-rows-based-on-matching-values/m-p/641812#M191361</link>
      <description>&lt;P&gt;I'm trying to insert rows in base table (WANT) based on the matching values 'run_id', but it's throwing error if I try with the code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I missing something in the where clause? I want to insert rows in base table only run_id matches between base table (WANT)&amp;nbsp;and &amp;amp;tab.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql undo_policy=none;
Insert into IFR.WANT (table_name,table_count) 
select table_name,table_count from &amp;amp;tab where run_id in (select run_id from &amp;amp;tab);
quit;&lt;/PRE&gt;
&lt;PRE&gt;WARNING: The SQL option UNDO_POLICY=REQUIRED is not in effect. If an error is detected when processing this INSERT statement, that 
         error will not cause the entire statement to fail.
ERROR: CLI execute error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Cannot insert the value NULL into column 
       'RUN_ID', table 'IFR.WANT'; column does not allow nulls. INSERT fails. : [SAS][ODBC SQL Server Wire 
       Protocol driver][Microsoft SQL Server]The statement has been terminated.
NOTE: 1 row was inserted into IFR.WANT-- of these 1 row was rejected as an ERROR, leaving 0 rows that were inserted 
      successfully.&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Apr 2020 04:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-rows-based-on-matching-values/m-p/641812#M191361</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-22T04:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Insert rows based on matching values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-rows-based-on-matching-values/m-p/641813#M191362</link>
      <description>&lt;P&gt;I think you either have to supply a value for run_id in the insert instruction or define run_id in the receiving table to automatically generate an id (type=autonumber in some databases)&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 04:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-rows-based-on-matching-values/m-p/641813#M191362</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-04-22T04:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Insert rows based on matching values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Insert-rows-based-on-matching-values/m-p/641832#M191375</link>
      <description>&lt;P&gt;It's a case of Maxim 3: Know Your Data. This also means to know the integrity rules set up for a target table in a remote database, which then gives you the information you need to prepare your update table correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 07:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Insert-rows-based-on-matching-values/m-p/641832#M191375</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-22T07:48:59Z</dc:date>
    </item>
  </channel>
</rss>

