<?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 Fetching data through Native SQL in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-through-native-sql/m-p/3750765#M902362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   What is the use of FETCH NEXT while fetching the data from the tables using Native SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the error 923 in Native SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Roja Velagapudi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 May 2008 06:14:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-02T06:14:00Z</dc:date>
    <item>
      <title>Fetching data through Native SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-through-native-sql/m-p/3750765#M902362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   What is the use of FETCH NEXT while fetching the data from the tables using Native SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the error 923 in Native SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Roja Velagapudi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 06:14:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-through-native-sql/m-p/3750765#M902362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T06:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data through Native SQL</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-through-native-sql/m-p/3750766#M902363</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;Basic form&lt;/P&gt;&lt;P&gt;FETCH NEXT CURSOR c target.&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Uses the cursor c to read the next line or lines from the dataset of a database table determined by OPEN CURSOR . The cursor must be a variable of the type CURSOR and must be explicitly opened with OPEN CURSOR . To specify the target area into which you read the selected data, use INTO clause target .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FETCH belongs to the Open SQL command set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After each execution of the FETCH statement, the system field SY-DBCNT contains the number of lines read so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The return code value is set as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0 At least one line was read.&lt;/P&gt;&lt;P&gt;SY_SUBRC = 4 No line was read.&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Output the passenger list for the Lufthansa flight 0400 on 28-02.1995:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

TABLES SBOOK.
DATA C TYPE CURSOR,
WA LIKE SBOOK.
OPEN CURSOR C FOR SELECT * FROM SBOOK
WHERE
CARRID = 'LH ' AND
CONNID = '0400' AND
FLDATE = '19950228'
ORDER BY PRIMARY KEY.

DO.
FETCH NEXT CURSOR C INTO WA.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
CLOSE CURSOR C. EXIT.
ENDIF.
WRITE: / WA-BOOKID, WA-CUSTOMID, WA-CUSTTYPE,
WA-SMOKER, WA-LUGGWEIGHT, WA-WUNIT,
WA-INVOICE.
ENDDO.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this help, Do reward.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 06:41:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-through-native-sql/m-p/3750766#M902363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T06:41:29Z</dc:date>
    </item>
  </channel>
</rss>

