<?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 IN list operator limit (ERROR : ORACLE prepare error: ORA-00972: identifier is too long) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IN-list-operator-limit-ERROR-ORACLE-prepare-error-ORA-00972/m-p/28411#M5224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks SASjedi.It really helped.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2011 15:03:20 GMT</pubDate>
    <dc:creator>4john</dc:creator>
    <dc:date>2011-07-11T15:03:20Z</dc:date>
    <item>
      <title>IN list operator limit (ERROR : ORACLE prepare error: ORA-00972: identifier is too long)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-list-operator-limit-ERROR-ORACLE-prepare-error-ORA-00972/m-p/28409#M5222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Below is a sample code that I have written.I am just wondering if there is any limitation on the number of values IN operator can hold.In the below example SELECT statement in step 5 holds more than 10000 ids.&lt;/P&gt;&lt;P&gt;LOG file shows the ERROR : ORACLE prepare error: ORA-00972: identifier is too long&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table TEST as&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from &lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oracle.sample &lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where id&lt;STRONG&gt; in &lt;/STRONG&gt;( select unique id from orcl.notice) ;&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any inputs would be really appreciated.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 15:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-list-operator-limit-ERROR-ORACLE-prepare-error-ORA-00972/m-p/28409#M5222</guid>
      <dc:creator>4john</dc:creator>
      <dc:date>2011-07-09T15:50:01Z</dc:date>
    </item>
    <item>
      <title>IN list operator limit (ERROR : ORACLE prepare error: ORA-00972: identifier is too long)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-list-operator-limit-ERROR-ORACLE-prepare-error-ORA-00972/m-p/28410#M5223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a limit to the number of values ORACLE will accept on an IN operator (in ORACLE 10g, 1000 is the max).&amp;nbsp; Consider using a join to an in-line view.&amp;nbsp; Something like this might do the trick:&lt;/P&gt;&lt;PRE&gt;
proc sql;
create table TEST as
&amp;nbsp;&amp;nbsp; select s.* 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from oracle.sample as s,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select unique id from orcl.notice) as list
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where s.id=list.id
;
quit;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another option is to make a temp table out of the results of the subquery, and use that for a join.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, you might try splitting the list results into segments of 1000 or less and using separate IN operators and logical ORs:&lt;BR /&gt;"where ID in (1,2,3...,999) OR ID in(1000,1001,1002,...1999)" etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Jul 2011 19:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-list-operator-limit-ERROR-ORACLE-prepare-error-ORA-00972/m-p/28410#M5223</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2011-07-10T19:08:25Z</dc:date>
    </item>
    <item>
      <title>IN list operator limit (ERROR : ORACLE prepare error: ORA-00972: identifier is too long)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IN-list-operator-limit-ERROR-ORACLE-prepare-error-ORA-00972/m-p/28411#M5224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks SASjedi.It really helped.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 15:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IN-list-operator-limit-ERROR-ORACLE-prepare-error-ORA-00972/m-p/28411#M5224</guid>
      <dc:creator>4john</dc:creator>
      <dc:date>2011-07-11T15:03:20Z</dc:date>
    </item>
  </channel>
</rss>

