<?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 Writing to Oracle database using ODBC connection in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35326#M6965</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have SAS 9.3 on a PC, it is connecting to the database using ODBC connection.&amp;nbsp; I can read tables easily enough using the pass through facility but when I try to write using a data step, it is taking a long time and then terminating the connection.&amp;nbsp; None of the searches on web led me to an example that shows how to write to ODBC using the pass through facility.&amp;nbsp; If anyone has any examples I can use, I would appreciate it.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jul 2011 18:03:42 GMT</pubDate>
    <dc:creator>Payal</dc:creator>
    <dc:date>2011-07-21T18:03:42Z</dc:date>
    <item>
      <title>Writing to Oracle database using ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35326#M6965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have SAS 9.3 on a PC, it is connecting to the database using ODBC connection.&amp;nbsp; I can read tables easily enough using the pass through facility but when I try to write using a data step, it is taking a long time and then terminating the connection.&amp;nbsp; None of the searches on web led me to an example that shows how to write to ODBC using the pass through facility.&amp;nbsp; If anyone has any examples I can use, I would appreciate it.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 18:03:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35326#M6965</guid>
      <dc:creator>Payal</dc:creator>
      <dc:date>2011-07-21T18:03:42Z</dc:date>
    </item>
    <item>
      <title>Writing to Oracle database using ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35327#M6966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Payal,&lt;/P&gt;&lt;P&gt;I would think this to be the syntax you can use while updating the tables in Oracle -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL; *replace lowercase font with your tables/connection info&lt;/P&gt;&lt;P&gt;CONNECT TO myconn (USER =oracleuserid PASSWORD=oraclepw&amp;nbsp; PATH=oraclepath);&lt;/P&gt;&lt;P&gt;CREATE TABLE TEST AS AS SELECT * FROM myconn&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/P&gt;&lt;P&gt;UPDATE schema_name.table_name alias&lt;/P&gt;&lt;P&gt;SET alias.column1=value, alias.column2=value2,...&lt;/P&gt;&lt;P&gt;WHERE alias.some_column=some_value&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;DISCONNECT FROM myconn;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it has been some time since I have tried an UPDATE (since you are asking about writing to the database). So, please always check with your local admin. Also, I am not sure if the syntax is different for 9.1.3 vs 9.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;saspert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 19:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35327#M6966</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-07-21T19:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to Oracle database using ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35328#M6967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for answering.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think this solution will work for me.&amp;nbsp; The problem is that my data is in a SAS dataset (i.e. work.datasetname) and it has millions of rows so I don't think I can just use update for one row at a time.&amp;nbsp; I used the following syntax but that's where I got the timing error:&lt;/P&gt;&lt;P&gt;Data SCHEMA.test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set work.test;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ﻿I am hoping for something that will let me do the following (albeit work.test is not recognized in Oracle):&lt;/P&gt;&lt;P&gt;﻿&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; connect to odbc(user=xxx password=xxx! dsn=Database INSERTBUFF=3000);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; execute (&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; create table Schema.test as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select id, amount, date1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from work.test&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) by odbc;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 19:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35328#M6967</guid>
      <dc:creator>Payal</dc:creator>
      <dc:date>2011-07-21T19:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to Oracle database using ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35329#M6968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought when you used pass-through you needed to use SQL code, not SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ie use 'into' rather than 'create table as' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select id, amount, date1&lt;/P&gt;&lt;P&gt;into schema.test&lt;/P&gt;&lt;P&gt;from work.test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You also don't need to do it through the pass through facility. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this paper, its for Teradata but maybe something similar for Oracle?&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/resources/papers/proceedings11/105-2011.pdf"&gt;http://support.sas.com/resources/papers/proceedings11/105-2011.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 20:37:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35329#M6968</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2011-07-21T20:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to Oracle database using ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35330#M6969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Create table as is part of SQL code, so I tried to use that.&amp;nbsp; Per your suggestion, I tried the into, but it gave me the following error:&lt;/P&gt;&lt;P&gt;ERROR 79-322: Expecting a :.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I researched more, it seemed like into: is creating a macro variable rather than writing to a table.&amp;nbsp; Still, no resolution for me.&amp;nbsp; The reason I am using the pass through facility is because the database resides at a third party vendor location and I have to use ODBC to connect to it anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the suggestions though.&amp;nbsp; The paper you linked was very interesting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 20:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35330#M6969</guid>
      <dc:creator>Payal</dc:creator>
      <dc:date>2011-07-21T20:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to Oracle database using ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35331#M6970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok...could you post the code you used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also reference this paper:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CITE&gt;www2.&lt;STRONG&gt;sas&lt;/STRONG&gt;.com/proceedings/sugi29/106-29.pdf&lt;/CITE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;specifically on how to load tables into Oracle, its old, but perhaps some of those methods would work for you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I usually use a libname statement with an odbc connection and it works fine...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jul 2011 21:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35331#M6970</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2011-07-21T21:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to Oracle database using ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35332#M6971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; From my past experience I have seen it is quite cumbersome to load Oracle using Libname statment because there is usually less control over a dataset having 1 million rows. And on the other hand using Proc SQL Pass thu will allow only 1 record to be updated at a time. &lt;/P&gt;&lt;P&gt;Any other users who have faced similiar issues?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 18:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35332#M6971</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-07-22T18:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Writing to Oracle database using ODBC connection</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35333#M6972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Reeza - I was able to use the paper you linked and it worked very well.&amp;nbsp; Here's my code:&lt;/P&gt;&lt;P&gt;﻿﻿&lt;/P&gt;&lt;P&gt;libname mylib odbc user=xxx password=xxx dsn=DSNNAME insertbuff=32767;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table mylib.trans_test as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select * from work.trans&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roughly 13.5 million records were written in 30 minutes.&amp;nbsp; Much better than what I was getting previously.&amp;nbsp; Thank you for all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 18:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Writing-to-Oracle-database-using-ODBC-connection/m-p/35333#M6972</guid>
      <dc:creator>Payal</dc:creator>
      <dc:date>2011-07-22T18:44:24Z</dc:date>
    </item>
  </channel>
</rss>

