<?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 select query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954651#M945123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Frens, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where in which i need to select some 1000 records at once from a master DB table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For that, i know we can use 'cursor' which implicitly takes care of the index DB pointer, which allows to read 1000 then 1000 records,so on sequentially. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case of a RFC call, i should not use cursor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence the option that i have left is use some condition in select query to fetch 1000 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the select query : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select distinct addrnumber  from ADRC&lt;/P&gt;&lt;P&gt;      into corresponding fields of table sel_tab&lt;/P&gt;&lt;P&gt;      up to 1000 rows&lt;/P&gt;&lt;P&gt;      where addrnumber GE ls_addrnumber &lt;/P&gt;&lt;P&gt;     order by addrnumber. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here ls_addrnumber stores last read Addrnumber. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query can select 1000 records at once. But the problem i have is that, the database is always cannot be in a sorted manner. Hence the condition which i have used above to fetch next 1000 records will not be fruitful, there is a change of missing some records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody have any better solution. As i said earlier, i cannot use cursors. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reply asap,. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WIth Best regards, &lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2008 11:20:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-05T11:20:31Z</dc:date>
    <item>
      <title>select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954651#M945123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Frens, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where in which i need to select some 1000 records at once from a master DB table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For that, i know we can use 'cursor' which implicitly takes care of the index DB pointer, which allows to read 1000 then 1000 records,so on sequentially. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case of a RFC call, i should not use cursor. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence the option that i have left is use some condition in select query to fetch 1000 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the select query : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   select distinct addrnumber  from ADRC&lt;/P&gt;&lt;P&gt;      into corresponding fields of table sel_tab&lt;/P&gt;&lt;P&gt;      up to 1000 rows&lt;/P&gt;&lt;P&gt;      where addrnumber GE ls_addrnumber &lt;/P&gt;&lt;P&gt;     order by addrnumber. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here ls_addrnumber stores last read Addrnumber. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This query can select 1000 records at once. But the problem i have is that, the database is always cannot be in a sorted manner. Hence the condition which i have used above to fetch next 1000 records will not be fruitful, there is a change of missing some records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody have any better solution. As i said earlier, i cannot use cursors. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reply asap,. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WIth Best regards, &lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2008 11:20:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954651#M945123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-05T11:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954652#M945124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using package size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2008 11:22:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954652#M945124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-05T11:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954653#M945125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot use package size and up to rows serves the same purpose to restrict the number of enties. i cannot use package size in my case as it needs endselect. But the problem is with the condtion which selects next set of records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2008 11:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954653#M945125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-05T11:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954654#M945126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Either u have to modify table with one more ref field update that field while u r selecting set of 1000 records .&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;Take bunch records in Internal table and pass set of 1000 records in to another internal table for processing then delete these records from first internal table. That way u can proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards ,&lt;/P&gt;&lt;P&gt;Swarup&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2008 11:55:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954654#M945126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-05T11:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954655#M945127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved by myself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jun 2008 06:07:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/3954655#M945127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-09T06:07:02Z</dc:date>
    </item>
  </channel>
</rss>

