<?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 Proc SQL Multiple Columns Update in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Multiple-Columns-Update/m-p/12170#M1572</link>
    <description>Hello Experts,&lt;BR /&gt;
&lt;BR /&gt;
Is it possible to execute a multiple column update using proc sql?. Example Query:&lt;BR /&gt;
&lt;BR /&gt;
update tableA T&lt;BR /&gt;
set ( column1,&lt;BR /&gt;
       column2,&lt;BR /&gt;
       column3) = (select S.column1,&lt;BR /&gt;
                                   S.column2,&lt;BR /&gt;
                                   S.column3&lt;BR /&gt;
                         from tableB S&lt;BR /&gt;
                         where S.filter1 = T.Filter1)&lt;BR /&gt;
&lt;BR /&gt;
This type of update can be executed in Oracle&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help.&lt;BR /&gt;
&lt;BR /&gt;
Pablo.</description>
    <pubDate>Thu, 17 Feb 2011 18:18:38 GMT</pubDate>
    <dc:creator>Pablo</dc:creator>
    <dc:date>2011-02-17T18:18:38Z</dc:date>
    <item>
      <title>Proc SQL Multiple Columns Update</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Multiple-Columns-Update/m-p/12170#M1572</link>
      <description>Hello Experts,&lt;BR /&gt;
&lt;BR /&gt;
Is it possible to execute a multiple column update using proc sql?. Example Query:&lt;BR /&gt;
&lt;BR /&gt;
update tableA T&lt;BR /&gt;
set ( column1,&lt;BR /&gt;
       column2,&lt;BR /&gt;
       column3) = (select S.column1,&lt;BR /&gt;
                                   S.column2,&lt;BR /&gt;
                                   S.column3&lt;BR /&gt;
                         from tableB S&lt;BR /&gt;
                         where S.filter1 = T.Filter1)&lt;BR /&gt;
&lt;BR /&gt;
This type of update can be executed in Oracle&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help.&lt;BR /&gt;
&lt;BR /&gt;
Pablo.</description>
      <pubDate>Thu, 17 Feb 2011 18:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Multiple-Columns-Update/m-p/12170#M1572</guid>
      <dc:creator>Pablo</dc:creator>
      <dc:date>2011-02-17T18:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Multiple Columns Update</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Multiple-Columns-Update/m-p/12171#M1573</link>
      <description>I believe you have to do it this way:&lt;BR /&gt;
&lt;BR /&gt;
update tableA T&lt;BR /&gt;
set column1 = (select S.column1 from tableB S where S.filter1 = T.Filter1),&lt;BR /&gt;
column2 = (select S.column2 from tableB S where S.filter1 = T.Filter1),&lt;BR /&gt;
column3 = (select S.column1 from tableB S where S.filter1 = T.Filter1)&lt;BR /&gt;
where&lt;BR /&gt;
t.filter1 in (select filter1 from tableb);&lt;BR /&gt;
&lt;BR /&gt;
If you don't do the last criteria, then you will get null values populated when there is no match.</description>
      <pubDate>Thu, 17 Feb 2011 19:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Multiple-Columns-Update/m-p/12171#M1573</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-02-17T19:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Multiple Columns Update</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Multiple-Columns-Update/m-p/12172#M1574</link>
      <description>Thanks DBailey for your response.&lt;BR /&gt;
&lt;BR /&gt;
Yes, I was aware of that method with SAS, but it is not an option for me at the moment.  I just created a direct connection to Oracle so the update statement will be executed at the Database not at the SAS server and it is working ok. &lt;BR /&gt;
&lt;BR /&gt;
It seems like SAS does not support vector style queries.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your help.&lt;BR /&gt;
&lt;BR /&gt;
Pablo.</description>
      <pubDate>Thu, 17 Feb 2011 19:46:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-SQL-Multiple-Columns-Update/m-p/12172#M1574</guid>
      <dc:creator>Pablo</dc:creator>
      <dc:date>2011-02-17T19:46:06Z</dc:date>
    </item>
  </channel>
</rss>

