<?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: SAS Error : Error fetching from cursor. ORACLE error is ORA-01555 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770857#M244532</link>
    <description>SSNBR_LIST is about 10 M Row and its only one column.&lt;BR /&gt;i tried the option offered by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt; and it worked as a work around.&lt;BR /&gt;however i cant do this in all the codes or programs that im running since the access to write tables on the Oracle is limited.&lt;BR /&gt;i kind of understand your explanation however if you could guide me what should i try first or look into that would be great.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 28 Sep 2021 11:50:08 GMT</pubDate>
    <dc:creator>L5ive</dc:creator>
    <dc:date>2021-09-28T11:50:08Z</dc:date>
    <item>
      <title>SAS Error : Error fetching from cursor. ORACLE error is ORA-01555</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770819#M244522</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please i have an issue with my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im trying to create a table with 20 mill row&amp;nbsp; reading from oracle data base.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however i get the below log error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;374 create table soap_detl1 as&lt;BR /&gt;375 select a.ssnbr ,a.indnbr ,a.contnbr ,a.item ,a.qtycl ,a.qtyapp ,a.totcl ,a.totapp ,a.paid_amt ,a.exceedlimd&lt;BR /&gt;375 ! ,a.netamt ,a.prov_net_amt ,a.totrcvry&lt;BR /&gt;376 ,a.discd ,a.hasitems ,a.covnetamt ,a.treatperiod ,a.penaltyd ,a.reqnum ,a.untprice ,a.QTY_TYPE ,a.discount&lt;BR /&gt;376 ! ,a.pa_flg ,a.mnsrv&lt;BR /&gt;377 from &amp;amp;OPERATION..soapdetl_up a inner join ssnbr_list b&lt;BR /&gt;378 on a.ssnbr=b.ssnbr ;&lt;BR /&gt;ERROR: Error fetching from cursor. ORACLE error is ORA-01555: snapshot too old: rollback segment number 88 with name&lt;BR /&gt;"_SYSSMU88_4158259342$" too smallORA-02063: preceding line from STBDBLNK.&lt;/P&gt;&lt;P&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;379 quit;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 59:35.10&lt;BR /&gt;cpu time 2:26.56&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your support&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Ahmed Maher&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 08:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770819#M244522</guid>
      <dc:creator>L5ive</dc:creator>
      <dc:date>2021-09-28T08:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Error : Error fetching from cursor. ORACLE error is ORA-01555</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770821#M244524</link>
      <description>&lt;P&gt;This is an internal Oracle issue, see here:&amp;nbsp;&lt;A href="https://www.tekstream.com/resource-center/ora-01555-snapshot-too-old/" target="_blank" rel="noopener"&gt;https://www.tekstream.com/resource-center/ora-01555-snapshot-too-old/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think you will be able to solve this from the SAS side.&lt;/P&gt;
&lt;P&gt;The problem happens when the table you access from SAS is updated while you use it, and Oracle tries to provide you with a consistent state, rolling back the changes that are made simultaneously. When it runs out of resources to do this, you get 01555.&lt;/P&gt;
&lt;P&gt;I don't know if ACCESS to Oracle provides an option to prevent the use of a snapshot and allow inconsistent data.&lt;/P&gt;
&lt;P&gt;Since your query takes almost an hour and is just a subset based on a SAS WORK dataset, you need to speed that up.&lt;/P&gt;
&lt;P&gt;How large is WORK.SSNBR_LIST?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 08:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770821#M244524</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-28T08:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Error : Error fetching from cursor. ORACLE error is ORA-01555</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770829#M244526</link>
      <description>&lt;P&gt;The easiest way to speed your query up is to upload the SSNBR values you are interested in to a temp Oracle table, and perform the inner join in Oracle.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 09:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770829#M244526</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-09-28T09:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Error : Error fetching from cursor. ORACLE error is ORA-01555</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770855#M244530</link>
      <description>I tried this and it worked with only 26 Min real time run (50% Less Time)&lt;BR /&gt;&lt;BR /&gt;Thank you So much</description>
      <pubDate>Tue, 28 Sep 2021 11:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770855#M244530</guid>
      <dc:creator>L5ive</dc:creator>
      <dc:date>2021-09-28T11:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Error : Error fetching from cursor. ORACLE error is ORA-01555</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770856#M244531</link>
      <description>&lt;P&gt;Depending on the size of the lookup table, you could even try to make a WHERE condition out of it and put the data into the code.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 11:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770856#M244531</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-28T11:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Error : Error fetching from cursor. ORACLE error is ORA-01555</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770857#M244532</link>
      <description>SSNBR_LIST is about 10 M Row and its only one column.&lt;BR /&gt;i tried the option offered by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt; and it worked as a work around.&lt;BR /&gt;however i cant do this in all the codes or programs that im running since the access to write tables on the Oracle is limited.&lt;BR /&gt;i kind of understand your explanation however if you could guide me what should i try first or look into that would be great.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Sep 2021 11:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770857#M244532</guid>
      <dc:creator>L5ive</dc:creator>
      <dc:date>2021-09-28T11:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Error : Error fetching from cursor. ORACLE error is ORA-01555</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770868#M244536</link>
      <description>&lt;P&gt;This will only work for a limited number of items, as both the size of a macro variable (64K) and the size of a SQL statement have limits.&lt;/P&gt;
&lt;P&gt;Simple proof of concept:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data names;
input name $;
datalines;
Alfred
William
;

proc sql noprint;
select quote(name) into :list separated by ","
from names;
quit;

proc sql;
select * from sashelp.class
where name in (&amp;amp;list.);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, you can write the SQL code to a file (where you can have a lot more items in the IN list) and then %include that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename xx temp;

data _null_;
file xx;
set names end=done;
length line $100;
if _n_ = 1
then line = cats('proc sql; select * from sashelp.class where name in ("',name,'"');
else line = cats(',"',name,'"');
put line;
if done then put ");quit;";
run;

%include xx /source2;

filename xx clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will allow for a much longer list, as the size limit for SQL statements will be much higher than that for macro variables. Your code in the include should of course be tailored for explicit pass-through.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 12:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Error-Error-fetching-from-cursor-ORACLE-error-is-ORA-01555/m-p/770868#M244536</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-28T12:42:05Z</dc:date>
    </item>
  </channel>
</rss>

