<?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: difference between select single and select upto 1 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378123#M811135</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;&lt;/P&gt;&lt;P&gt;If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * upto one row selects only one row from the top...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the data object dobj, the first subsequence is searched for which contents match those of sub_string. However, uppercase/lowercase lettering is not taken into consideration. The content of the data object dobj will be shifted as far possible left or right - depending on the specification in direction - until the byte or character sequence contained in sub_string is at the position that is at the beginning or end of the data object dobj before the shift. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For sub_string, a byte or character-type data object is expected. Closing blanks in data ojects of fixed length are taken into consideration. If sub_string is an empty string, the position in front of the first character or byte is found. To the left, no shift will take place, and to the right there will be a shift by the entire length of dobj. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it clears the doubt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rohan malik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Feb 2008 05:30:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-21T05:30:08Z</dc:date>
    <item>
      <title>difference between select single and select upto 1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378117#M811129</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;exprts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please answer  me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;difference between select single and select upto 1 row&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 20:33:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378117#M811129</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T20:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: difference between select single and select upto 1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378118#M811130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just search the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 20:41:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378118#M811130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T20:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: difference between select single and select upto 1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378119#M811131</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;see if u rselecting table which has records like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a 2 xyz&lt;/P&gt;&lt;P&gt;a 2 yzx&lt;/P&gt;&lt;P&gt;a 3 xyz&lt;/P&gt;&lt;P&gt;a 4 xyz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u r slecting rows which has basically a 2 then when using slect single first system will get both the records and then it will show the first one among them as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a 2 xyz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when u use select upto one rows directly it will show the a 2 xyz it will not go for the second one again that if selction matches with the first one it will show it it will not go for next &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think i am clear to u &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 20, 2008 4:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 20:52:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378119#M811131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T20:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: difference between select single and select upto 1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378120#M811132</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;&lt;STRONG&gt;Select single&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If accessing tables for which SAP buffering is planned for single records, the SAP buffer is bypassed if the addition SINGLE is not specified. This behavior depends on the current implementation of the database interface and may change in future releases. In particular, it should not be used to bypass the SAP buffer. You should use the explicit addition BYPASSING BUFFER for this instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition SINLGE is not permitted in a subquery. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;... UP TO n ROWS&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition restricts the number of rows in the result set. A data object of the Type i is expected for n. A positive number in n indicates the maximum number of rows in the result set. If n contains the value 0, all selected rows are passed to the result set. If n contains a negative number, an exception that cannot be handled is raised. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to find out is through sql trace or runtime analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to read data from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rohini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2008 05:16:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378120#M811132</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-21T05:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: difference between select single and select upto 1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378121#M811133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to SAP Performance course the SELECT UP TO 1 ROWS is faster than SELECT SINGLE because you are not using all the primary key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to find out is through sql trace or runtime analysis. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use "select up to 1 rows" only if you are sure that all the records returned will have the same value for the field(s) you are interested in. If not, you will be reading only the first record which matches the criteria, but may be the second or the third record has the value you are looking for. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The System test result showed that the variant Single * takes less time than Up to 1 rows as there is an additional level for COUNT STOP KEY for SELECT ENDSELECT UP TO 1 ROWS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to read data from &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mainly: to check if entries exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2008 05:18:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378121#M811133</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-21T05:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: difference between select single and select upto 1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378122#M811134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select single , we use when we have all key fields in WHERE clause&lt;/P&gt;&lt;P&gt;and UP TO 1 ROWS in case we don't have all key fields in WHERE clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance wise, UP TO 1 rows is considered better when we are not having all key fields in WHERE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Taranam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2008 05:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378122#M811134</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-21T05:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: difference between select single and select upto 1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378123#M811135</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;&lt;/P&gt;&lt;P&gt;If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single * upto one row selects only one row from the top...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the data object dobj, the first subsequence is searched for which contents match those of sub_string. However, uppercase/lowercase lettering is not taken into consideration. The content of the data object dobj will be shifted as far possible left or right - depending on the specification in direction - until the byte or character sequence contained in sub_string is at the position that is at the beginning or end of the data object dobj before the shift. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For sub_string, a byte or character-type data object is expected. Closing blanks in data ojects of fixed length are taken into consideration. If sub_string is an empty string, the position in front of the first character or byte is found. To the left, no shift will take place, and to the right there will be a shift by the entire length of dobj. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it clears the doubt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rohan malik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2008 05:30:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378123#M811135</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-21T05:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: difference between select single and select upto 1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378124#M811136</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;SELECT SINGLE returns the first matching row for the given condition and it may not be unique, if there are more matching rows for the given condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ... UP TO 1 ROWS retrieves all the matching records and applies aggregation and ordering and returns the first record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inorder to check for the existence of a record then it is better to use SELECT SINGLE than using SELECT ... UP TO 1 ROWS since it uses low memory and has better performance."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2008 05:38:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-select-single-and-select-upto-1/m-p/3378124#M811136</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-21T05:38:06Z</dc:date>
    </item>
  </channel>
</rss>

