<?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: select single in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792863#M651689</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;when you use select single &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;then you should have all the primary key values&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it is not mandatory&lt;/P&gt;&lt;P&gt;in the extended progam check it will give you an error&lt;/P&gt;&lt;P&gt;if you dont give all the primary key values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you give some values then it will fetch the first record which satisfies that &lt;/P&gt;&lt;P&gt;conndition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select up to &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;then no need of all the primary key values&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;y because if you give some conditions in the where conditions&lt;/P&gt;&lt;P&gt;then it will fetch the first record which satisfies that condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;performance wise up to is good when compared with select single&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Venkatesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Sep 2007 10:33:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-01T10:33:37Z</dc:date>
    <item>
      <title>select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792861#M651687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anybody tell what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 10:27:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792861#M651687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T10:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792862#M651688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;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;&amp;lt;b&amp;gt;reward if Helpful &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 10:31:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792862#M651688</guid>
      <dc:creator>suredarreddy_pulimamidi</dc:creator>
      <dc:date>2007-09-01T10:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792863#M651689</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;when you use select single &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;then you should have all the primary key values&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it is not mandatory&lt;/P&gt;&lt;P&gt;in the extended progam check it will give you an error&lt;/P&gt;&lt;P&gt;if you dont give all the primary key values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you give some values then it will fetch the first record which satisfies that &lt;/P&gt;&lt;P&gt;conndition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select up to &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;then no need of all the primary key values&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;y because if you give some conditions in the where conditions&lt;/P&gt;&lt;P&gt;then it will fetch the first record which satisfies that condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;performance wise up to is good when compared with select single&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Venkatesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 10:33:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792863#M651689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T10:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792864#M651690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both are same  ,both query will get single record from database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use select single when you have key field ,then use select single otherwise you get performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use select up to 1 row any time ,if you do not have key field in where condition then use select up to 1 row instead of select single&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 10:33:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792864#M651690</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T10:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792865#M651691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select single should be used only if you specify the complete key as it should return a unique record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However upto 1 rows retrieves the first  record matching the selection criterion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS : Please reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Sep 2007 15:35:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792865#M651691</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-01T15:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792866#M651692</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 will find the first hit in the data base table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where as select up to gets the all the records as per the where condition and finally returnd first record &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single mainly used for validation perpouse &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 04:10:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792866#M651692</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T04:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792867#M651693</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;Select Single is the best one compared to UPto one rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select Single will get the first record from the table which satisfies the given condition.So it will interact once with the database.&lt;/P&gt;&lt;P&gt;UTO 1 rows will get the list of the records for the given match and iwll show the first record from the list.So it will take time to get the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE VBELN from VBAK&lt;/P&gt;&lt;P&gt;where MATNR = '1M20'.&lt;/P&gt;&lt;P&gt;---Thjis will get the first matched record and will display the record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT VBELN from VBAK&lt;/P&gt;&lt;P&gt;where MATNR = '1M20' upto 1 rows.&lt;/P&gt;&lt;P&gt;---Thjis will get the list of matched records and will display the first record &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Major difference between Select Single and Select UPTO 1 rows is The Usage Of Buffer for each.&lt;/P&gt;&lt;P&gt;Select Single will search for all the satisfied data and bring all that data into Buffer and later it will give to that data to the program.&lt;/P&gt;&lt;P&gt;Select UPTO 1 Rows will end the search after getting the 1st satisfied record and gives that record to the program.&lt;/P&gt;&lt;P&gt;Thus Select Single will take much processing time when compare with Select UPTO 1 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also&lt;/P&gt;&lt;P&gt;check these threads..&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="39947"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="229253"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="260525"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="152731"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="159458"&gt;&lt;/A&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;srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Sep 2007 06:20:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792867#M651693</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-03T06:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792868#M651694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reddy ,&lt;/P&gt;&lt;P&gt; The major different between select single and select up to 1 rows is .&lt;/P&gt;&lt;P&gt;In case of select single it will search whole data base and give the resume , here in where  condition is madatory , but in case of select up to 1 the control go to that rows and check the condition , if the condition is true it will give that result other it will show the first record of the database.&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;Nihar swain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2007 10:57:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/2792868#M651694</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-05T10:57:25Z</dc:date>
    </item>
  </channel>
</rss>

