<?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/5142890#M1192045</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since COUNT is an aggregate, it will likely have poorer performance. I think SELECT SINGLE ... INTO...is the best way.&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, 28 Jan 2009 16:31:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-28T16:31:34Z</dc:date>
    <item>
      <title>select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142886#M1192041</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;is there a way to use select single * without using into?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i just want to check the sy-subrc of the selection &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;Thread moved to Performance Tuning Forum&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vijay Babu Dudla on Jan 28, 2009 11:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:25:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142886#M1192041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T16:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142887#M1192042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;than you should use SELECT COUNT( * )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:26:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142887#M1192042</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2009-01-28T16:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142888#M1192043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No you have to use INTO with SELECT SINGLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;i just want to check the sy-subrc of the selection&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You should use SELECT COUNT * for this purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Eric shall i say duplicate post for this or the Mods will understand from the timings &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Jan 28, 2009 9:57 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:27:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142888#M1192043</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-28T16:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142889#M1192044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, there is a way. Declare corresponding structure with &lt;STRONG&gt;tables&lt;/STRONG&gt;. It will implicitly place an entry in that work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TABLES: tab_name.

SELECT SINGLE * FROM tab_name WHERE ....
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142889#M1192044</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-01-28T16:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142890#M1192045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since COUNT is an aggregate, it will likely have poorer performance. I think SELECT SINGLE ... INTO...is the best way.&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, 28 Jan 2009 16:31:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142890#M1192045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T16:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142891#M1192046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Point taken, but you cannot use SELECT SINGLE w/o INTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:33:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142891#M1192046</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-28T16:33:14Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142892#M1192047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's so bad about INTO?&lt;/P&gt;&lt;P&gt;Reminds me of the question "How can I sort a table without using SORT?"...&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:39:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142892#M1192047</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-01-28T16:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142893#M1192048</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;The only option to use without INTO statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Tables: VBAK.

SELECT SINGLE * FROM VBAK WHERE &amp;lt;CONDT&amp;gt;.
IF SY-SUBRC EQ 0.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:40:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142893#M1192048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T16:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142894#M1192049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still doing an INTO internally, you just don't see it...that's why TABLES is obsolete.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:42:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142894#M1192049</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-01-28T16:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142895#M1192050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hello Rob,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Point taken, but you cannot use SELECT SINGLE w/o INTO.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Suhas&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Yeah - I know it's not what the OP wanted. But it's the standard way to do it. Without any reason not to do it this way, that's what I would do.&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, 28 Jan 2009 16:42:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142895#M1192050</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T16:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142896#M1192051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can, like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: VBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM VBAK WHERE VBELN = '00000100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that I have used TABLES statement, which automatically creates a work area under the dictionary table name, so VBAK itself will stand for the table as well as work area. So no separate work area is required for INTO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142896#M1192051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T16:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142897#M1192052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can, like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: VBAK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM VBAK WHERE VBELN = '00000100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that I have used TABLES statement, which automatically creates a work area under the dictionary table name, so VBAK itself will stand for the table as well as work area. So no separate work area is required for INTO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:43:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142897#M1192052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T16:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142898#M1192053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Since COUNT is an aggregate, it will likely have poorer performance. I think SELECT SINGLE ... INTO...is the best way.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Rob&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did a fast test on table BKPF (SE38 =&amp;gt; Performance ...):&lt;/P&gt;&lt;P&gt;SELECT SINGLE * is clearly slower, than SELECT COUNT( * )&lt;/P&gt;&lt;P&gt;SELECT SINGLE &amp;lt;specific_field&amp;gt; takes more or less the same time, than SELECT COUNT( * )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(this is a development system, number of entries in BKPF: about 120K)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:44:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142898#M1192053</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2009-01-28T16:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142899#M1192054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I did a fast test on table BKPF (SE38 =&amp;gt; Performance ...):&lt;/P&gt;&lt;P&gt;&amp;gt; SELECT SINGLE * is clearly slower, than SELECT COUNT( * )&lt;/P&gt;&lt;P&gt;&amp;gt; SELECT SINGLE &amp;lt;specific_field&amp;gt; takes more or less the same time, than SELECT COUNT( * )&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; (this is a development system, number of entries in BKPF: about 120K)&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you do each more than once and take the lowest?&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, 28 Jan 2009 16:50:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142899#M1192054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T16:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142900#M1192055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was pressing the 'Measure time' button more than ten times (in both cases).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:51:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142900#M1192055</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2009-01-28T16:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142901#M1192056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it doesn't seem right. I'll try to look into it.&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, 28 Jan 2009 16:54:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142901#M1192056</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T16:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142902#M1192057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keeping my fingers crossed !!! Share your findings with us Rob !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 16:59:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142902#M1192057</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-28T16:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142903#M1192058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK - not the results I expected. I ran this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

TABLES: ekko.

PARAMETERS p_ebeln LIKE ekko-ebeln OBLIGATORY MEMORY ID bes.

DATA: start    TYPE i,
      end      TYPE i,
      dif      TYPE i,
      count    TYPE i.

SELECT COUNT( * ) FROM ekko
  INTO count
  WHERE ebeln = p_ebeln.

DO 5 TIMES.
  GET RUN TIME FIELD start.
  SELECT COUNT( * ) FROM ekko
    INTO count
    WHERE ebeln = p_ebeln.
  GET RUN TIME FIELD end.
  dif = end - start.
  WRITE: /001 'Time for SELECT COUNT( * )', ':', dif, 'microseconds'.
ENDDO.

SELECT SINGLE ebeln FROM ekko
  INTO ekko-ebeln
  WHERE ebeln = p_ebeln.

DO 5 TIMES.
  GET RUN TIME FIELD start.
  SELECT SINGLE ebeln FROM ekko
    INTO ekko-ebeln
    WHERE ebeln = p_ebeln.
  GET RUN TIME FIELD end.
  dif = end - start.
  WRITE: /001 'Time for SELECT SINGLE *  ', ':', dif, 'microseconds'.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and got pretty much the same results as Eric. I also did an explain from ST05 and they were almost identical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Mea culpa.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran this in a DB2 ECC6 environment. I'd be interested to learn of results from other releases (particulary older ones).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vijay Babu Dudla on Jan 28, 2009 11:01 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2009 20:16:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142903#M1192058</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-28T20:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142904#M1192059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Rob,&lt;/P&gt;&lt;P&gt;what you expect is not completely wrong, there are recommendation out, which say, that count(*) will&lt;/P&gt;&lt;P&gt;first build up the aggregate over all entries. But in newer systems this is definitely not true. I can not say whether all systems behave that way, that they don't check all records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The actual recommendations are however still different:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+ either &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   SELECT COUNT(*)
                INTO numb
                FROM db
                UP TO 1 ROWS
                WHERE ...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if it is a fully specified key, i.e. a SELECT wqith primary key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   SELECT SINGLE key1
                INTO ls_db_tab
                FROM db_tab
                WHERE key1 = ...  key2 = ...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The INTO is required in newer systems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2009 07:54:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142904#M1192059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-29T07:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: select single</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142905#M1192060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; I ran this in a DB2 ECC6 environment. I'd be interested to learn of results from other releases (particulary older ones).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No difference on ECC6 with Oracle 10. Sorry, can't help with older releases.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2009 08:31:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-single/m-p/5142905#M1192060</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-01-29T08:31:01Z</dc:date>
    </item>
  </channel>
</rss>

