<?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: Insert SAS table values into Oracle table in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/442957#M69313</link>
    <description>&lt;P&gt;On the INSERT part Oracle is trying to reference the table SAS_Table as a local Oracle table, not the SAS table you created previously.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;execute(
INSERT INTO TEST_SAS_INSERT
select count(*) from SAS_Table
) by oracle;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;&amp;nbsp;mentioned, in this case the best way to handle it is via implicit SQL pass through rather than explicit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 16:33:45 GMT</pubDate>
    <dc:creator>Sven111</dc:creator>
    <dc:date>2018-03-06T16:33:45Z</dc:date>
    <item>
      <title>Insert SAS table values into Oracle table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/442773#M69305</link>
      <description>&lt;P&gt;I have created a SAS table like&lt;/P&gt;&lt;P&gt;Create table DX.SAS_Table as&lt;BR /&gt;select * from connection to oracle&lt;BR /&gt;(&lt;BR /&gt;select * from my table&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Now I want to insert count of SAS_Table into another Oracle table, so I did this&lt;/P&gt;&lt;P&gt;Proc sql;&lt;BR /&gt;connect to oracle (connection..!)&lt;BR /&gt;execute(&lt;BR /&gt;INSERT INTO TEST_SAS_INSERT&lt;BR /&gt;select count(*) from SAS_Table&lt;BR /&gt;) by oracle;&lt;BR /&gt;quit;&lt;BR /&gt;It throwing me the error **ERROR: ORACLE execute error: ORA-00942: table or view does not exist**, I tried this Select count(*) from Dual its working but not from SAS_Table I understood this throw error Oracle considering SAS_table as oracle table, How can I do this?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 07:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/442773#M69305</guid>
      <dc:creator>Pradeepbanu</dc:creator>
      <dc:date>2018-03-06T07:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: Insert SAS table values into Oracle table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/442890#M69308</link>
      <description>&lt;P&gt;Don't use explicit SQL pass through, write your SQL targeting a libref pointing to your Oracle schema.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW: your first query doesn't benefit from explicit pass-through, you you use a libref in that case as well.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 14:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/442890#M69308</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-03-06T14:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Insert SAS table values into Oracle table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/442957#M69313</link>
      <description>&lt;P&gt;On the INSERT part Oracle is trying to reference the table SAS_Table as a local Oracle table, not the SAS table you created previously.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;execute(
INSERT INTO TEST_SAS_INSERT
select count(*) from SAS_Table
) by oracle;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;&amp;nbsp;mentioned, in this case the best way to handle it is via implicit SQL pass through rather than explicit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 16:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/442957#M69313</guid>
      <dc:creator>Sven111</dc:creator>
      <dc:date>2018-03-06T16:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Insert SAS table values into Oracle table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/443707#M69347</link>
      <description>&lt;P&gt;Why not just insert the number of observations previously selected, which is returned in the SQLOBS macro variable:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table DX.SAS_Table as
select * from connection to oracle
(
select * from my table
);
execute by Oracle(
  insert into TEST_SAS_INSERT values(&amp;amp;sqlobs)
  );

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you want to insert data from SAS tables into Oracle tables, the easiest is normally to allocate the Oracle connection as a SAS library:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname Oralib Oracle &amp;lt;connection options here&amp;gt;;

Proc sql;
  INSERT into Oralib.TEST_SAS_INSERT
  select count(*) from SAS_Table
 ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Mar 2018 10:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/443707#M69347</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-03-08T10:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into SAS table using oracle table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/588532#M75907</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;I need to insert data for single column into SAS dataset using orcale table.please help&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 14:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/588532#M75907</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-09-13T14:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into SAS table using oracle table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/588785#M75911</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please don't piggyback on old discussions but ask a new question. Eventually post a link to an old discussion if it's relevant for what you're asking.&lt;/P&gt;
&lt;P&gt;As the owner of the new question you will then also be able to select one of the answers as solution and though close the discussion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you're after doesn't appear to be hard but I'm not going to give an answer here.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Sep 2019 00:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/588785#M75911</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-15T00:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into SAS table using oracle table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/588947#M75921</link>
      <description>Sorry &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;,Thanks for correction,I have created new one please</description>
      <pubDate>Mon, 16 Sep 2019 06:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insert-SAS-table-values-into-Oracle-table/m-p/588947#M75921</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-09-16T06:14:35Z</dc:date>
    </item>
  </channel>
</rss>

