SELECT COUNT( ) gives warning in ECC6.0.

Hi,
The following query is giving syntax error in ECC6.0, where as it worked absolutely fine in 3.1i server.
SELECT COUNT( OBOX_CNTNO ) FROM  ZT2OB
                             INTO  W_COUNT
                             WHERE SUPPL_CD   = W_SUPPL_CD
                             AND   INVC_NO    = W_INVC_NO
                             AND   INVC_LN_NO = T_SCR_ITEMS-INVC_LN_NO.
Error: "COUNT( OBOX_CNTNO )" is only valid in the extended form "COUNT( DIS
OBOX_CNTNO )" . . .
The query seems obsolete in ECC6.0. Can anybody help me to give valid query for this in ECC6.0?

Hi,
<b>Count</b> functionality is to be used along with <b>Distinct</b> functionality.
COUNT( DISTINCT col )
<b>Reward points if this helps,</b>
Kiran

Similar Messages

  • Select count(*) gives different value

    Hi Experts,
    I have a table with more tnan 50 thousand records with 8 indexes.
    When i am trying below query
    select * from customer_table
              WHERE line_id IS NULL
              AND balance >= 0
              AND dept_code = '233'
              AND overline IS NOT NULL
              AND rstat= 'O'
              AND astat ='A';
    i am getting 61 rows however when i am trying
         select count(*) from customer_table
              WHERE line_id IS NULL
              AND balance >= 0
              AND dept_code = '233'
              AND overline IS NOT NULL
              AND rstat= 'O'
              AND astat ='A';
    i am getting 43. it is strange to get different results..
    I did index rebuild and even recreation of indexes also..still same result..
    does any body have any clue abut this...
    plz help..

    Please post your (4 digit) Oracle version.
    You can try the same select in SQL*PLus just to rule out any issues with SQL Navigator.
    I guess you did run those two statements several times and the result of consistent? If not then some other user/automatic job could be changing data and commitiing between your two selects.
    Furthermore you can use the NO_INDEX hint on both selects, just to rule out any index problems.
    Since you have only 61 rows max. you can add a few more restrictions and by that find out which rows are not counted.
    Edited by: Sven W. on Aug 26, 2009 2:43 PM

  • Performance issue when using select count on large tables

    Hello Experts,
    I have a requirement where i need to get count of data  from a database table.Later on i need to display the count in ALV format.
    As per my requirement, I have to use this select count inside a nested loops.
    Below is the count snippet:
    LOOP at systems assigning <fs_sc_systems>.
    LOOP at date assigning <fs_sc_date>.
    SELECT COUNT( DISTINCT crmd_orderadm_i~header )
       FROM crmd_orderadm_i
       INNER JOIN bbp_pdigp
           ON crmd_orderadm_iclient EQ bbp_pdigpclient               "MANDT is referred as client
         AND crmd_orderadm_iguid  EQ bbp_pdigpguid
         INTO w_sc_count
    WHERE crmd_orderadm_i~created_at BETWEEN <fs_sc_date>-start_timestamp
         AND <fs_sc_date>-end_timestamp
         AND bbp_pdigp~zz_scsys   EQ <fs_sc_systems>-sys_name.
    endloop.
    endloop.
    In the above code snippet,
    <fs_sc_systems>-sys_name is having the system name,
    <fs_sc_date>-start_timestamp is having the start date of month
    and <fs_sc_date>-end_timestamp is the end date of month.
    Also the data in tables crmd_orderadm_i and bbp_pdigp is very large and it increases every day.
    Now,the above select query is taking a lot of time to give the count due to which i am facing performance issues.
    Can any one pls help me out to optimize this code.
    Thanks,
    Suman

    Hi Choudhary Suman ,
    Try this:
    SELECT crmd_orderadm_i~header
      INTO it_header                 " interna table
      FROM crmd_orderadm_i
    INNER JOIN bbp_pdigp
        ON crmd_orderadm_iclient EQ bbp_pdigpclient
       AND crmd_orderadm_iguid   EQ bbp_pdigpguid
       FOR ALL ENTRIES IN date
    WHERE crmd_orderadm_i~created_at BETWEEN date-start_timestamp
                                          AND date-end_timestamp
       AND bbp_pdigp~zz_scsys EQ date-sys_name.
        SORT it_header BY header.
        DELETE ADJACENT DUPLICATES FROM it_header
        COMPARING header.
        describe table it_header lines v_lines.
    Hope this information is help to you.
    Regards,
    José

  • Select count from large fact tables with bitmap indexes on them

    Hi..
    I have several large fact tables with bitmap indexes on them, and when I do a select count from these tables, I get a different result than when I do a select count, column one from the table, group by column one. I don't have any null values in these columns. Is there a patch or a one-off that can rectify this.
    Thx

    You may have corruption in the index if the queries ...
    Select /*+ full(t) */ count(*) from my_table t
    ... and ...
    Select /*+ index_combine(t my_index) */ count(*) from my_table t;
    ... give different results.
    Look at metalink for patches, and in the meantime drop-and-recreate the indexes or make them unusable then rebuild them.

  • Select count(*) for each row of a table

    Hello All,
    Following query gives a statistics for each user (how many items he owns, home many tickets authored, how many objects he is subscribed to etc...)
    select auser.userid,
    (select count(*) from item where owner like '%' || auser.id || '%') ITEM_OWNER_CNT,
    (select count(*) from tkt where originator = auser.id) TKT_ORIGINATE_CNT,
    (select count(*) from tkt where assigned_to = auser.id) TKT_QA_CNT,
    (select count(*) from tkt where create_user = auser.id) TKT_AUTHOR_CNT,
    (select count(*) from subscriptions where subscriber_id = auser.id) SUBSCRIPTION_CNT
    from
    user auser
    I was not happy with the performance of this query, so I tried the same using group by. The performance was even worse.
    Is there any other option for me to try? Please advice.
    Thanks,
    Sathish

    Hi, Sathish,
    As SBH said, a lot depends on your data. Please post some sample data (CREATE TABLE adn INSERT statemetns) for all tables, and the results you want from that data. Describe and give examples of any relationships that are not one-to-one..
    You probably want to do joings, like SBH suggested, rather than scalar sub-queries.
    The connection between the auser and item tables
    (select count(*) from item where owner like '%' || auser.id || '%') ITEM_OWNER_CNT,is very suspicious. Perhaps the item table is poorly designed, and the query would be faster if that table were changed. Is changing the design of the item table an option?
    You should be able to get all the information from the tkt table in one pass. It looks like you need to unpivot the data, so instead of one row per ticket (with 3 different people connected to it), there are 3 rows per ticket, each with only 1 person referenced. This is not necessarily a bad table design. Unpivoting, even more than most other things, depends on your database version, so you'll have to tell what version of Oracle you're using.

  • Select count into versus create table as in functions/procedures

    I am working on a dynamic PL/SQL script that will count the number of records in a remote database
    based on certain criteria and then if the number is "acceptable" will create a table in the connecting
    database with those records.
    My where clauses are supposed to be the same but I am presented with the problem, when I run the
    first code ... select in to rowcount I get 122000 records, when I later do the create table as
    with the same whereclause code, I get 77 records. So now I am attempting to validate that the two
    where clauses are the same ... you'd think it would be obvious, but it's not.
    My first operation does a select count(*) into rowcount with the where clause behind it.
    The second operations creates a "sql command literal' that gets executed and returns the less value.
    I build it like testscript := 'create table '||tablename ||'as select * from '||remotetablename||'@'||linkname;
    testwhere := ' xxxxxxx'
    then I do an execute immediate teststring ||' ' testwhere; which works but gives me 77 rows in the table.
    Since I believe my where clause might be different, how can I run the first operation ... select count into rowcount
    as a normal SQL statement in the script...
    When I attempt to just run it I get -- PLS-00428: an into clause expected in this select statement......
    I will provide the source code in my next posting. Working to get it moved to this system.. Once you see it you'll understand
    why I don't think, it's the same, but I need a way to run them exactly as they are written to understand the different results.
    so How can I make the select count (*) into rowcount from .... work just like a normal select

    Here is first part of the procedure --- I get returned value of 122000 records ....
    SELECT COUNT (*)
                   INTO ROWCOUNT
                   FROM A_K_A_D_TBL@FCA08_INGRES
                   WHERE (( "a_" = '1' OR "a_" = '6' ) AND
                             ( "d_t" <> '3' OR "k_c_s" = 'Y' ) AND
                             "d_d" < DATECUTOFFDATE AND
                        "k_c_d" < DATECUTOFFDATE )OR
    (( "a_" = 4 OR "a_" = 7 ) AND
                             ( "d_t" <> '3' OR
    "k_c_s" = 'Y' OR
    "r_t" = '0' OR
                        "r_t" = '2' OR
                   "r_t" = '3' ) AND
                        "d_d" < DATECUTOFFDATE AND
                        "k_c_d" < DATECUTOFFDATE AND
                        "r_d" < DATECUTOFFDATE AND
                        "s_d" < DATECUTOFFDATE);
    then I attempt to duplicate it for string literals.... when this runs ... I get only 77 records. So that makes me think that my strings are not
    done properly.
    So I want to try to run the first sql itself ... but then I get the errors about needing select into ..... etc..
                   TESTWHERE := q'[WHERE (( "a_" = '1' OR "a_" = '6' ) AND ( "d_t" <> '3' OR "k_c_s" = 'Y' )]'||
              q'[ AND "d_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "k_c_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[')]'||
                             q'[ OR (( "a_" = 4 OR "a_" = 7 )]'||
                             q'[ AND ( "d_t" <> '3' OR "k_c_s" = 'Y' OR "r_t" = '0' OR "r_t" = '2' OR "r_t" = '3' )]'||
                             q'[ AND "d_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "k_c_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "r_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "s_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[')]';
                        TESTSTRING := 'CREATE TABLE '||UCASEXTABLENAMETEMP||' AS SELECT * FROM '||UCASEXTABLENAME||'@'||XLINKNAME;
                        DBMS_OUTPUT.PUT_LINE(TESTSTRING);
                        DBMS_OUTPUT.PUT_LINE(TESTWHERE);
                        EXECUTE IMMEDIATE TESTSTRING||' '||TESTWHERE;

  • "select count(*) from dba_jobs_running" takes 5 minutes to return

    Hi,
    I login as sys or system from sql*plus to run query "select count(*) from dba_jobs_running". This query takes about 5 minutes to run.
    Querying other DBA_* views returns instantly, only this dba_jobs_running view is troubling.
    I have 11 records in dba_jobs, and 18 records in v$lock as usual.
    No error or warning in logfile, no trace file.
    What's possibly wrong with the server?
    Thanks,
    Harry

    Hi,
    The following are the exact statements I used to create the trace file:
    alter session set timed_statistics=true;
    alter session set max_dump_file_size=unlimited;
    alter session set events '10046 trace name context forever, level 12';
    select count(*) from dba_jobs_running;
    exit;
    The content of the trace file is attached at the end.
    If it is CPU bound, I have no activity on the db host. I am solely using it to analyze this problem.
    load averages: 0.02, 0.02, 0.07 22:16:38
    48 processes: 47 sleeping, 1 on cpu
    CPU states: 98.4% idle, 1.6% user, 0.0% kernel, 0.0% iowait, 0.0% swap
    Memory: 1792M real, 983M free, 517M swap in use, 2937M swap free
    PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
    655 oracle 1 59 0 0K 0K sleep 1:14 0.32% oracle
    865 oracle 1 59 0 2072K 1184K cpu 0:00 0.14% top
    667 oracle 1 59 0 0K 0K sleep 0:13 0.08% oracle
    663 oracle 1 59 0 0K 0K sleep 0:27 0.07% oracle
    665 oracle 1 59 0 0K 0K sleep 0:15 0.02% oracle
    671 oracle 1 59 0 0K 0K sleep 0:00 0.02% oracle
    645 oracle 18 59 0 0K 0K sleep 0:23 0.01% oracle
    657 oracle 1 59 0 0K 0K sleep 0:14 0.00% oracle
    649 oracle 1 59 0 0K 0K sleep 0:02 0.00% oracle
    659 oracle 1 59 0 0K 0K sleep 0:01 0.00% oracle
    251 root 20 59 0 3256K 2512K sleep 0:00 0.00% nscd
    70 root 5 59 0 2864K 2096K sleep 0:00 0.00% picld
    224 root 3 59 0 3912K 2008K sleep 0:00 0.00% automountd
    271 root 1 59 0 4408K 1896K sleep 0:00 0.00% sendmail
    588 oracle 1 59 0 2600K 1864K sleep 0:00 0.00% bash
    Any help is greatly appreciated.
    <-- TRACE FILE CONTENT -->
    *** 2006-11-21 21:34:54.413
    *** SESSION ID:(21.832) 2006-11-21 21:34:54.412
    APPNAME mod='[email protected] (TNS V1-V3)' mh=0 act='' ah=0
    =====================
    PARSING IN CURSOR #1 len=69 dep=0 uid=0 oct=42 lid=0 tim=107123626140 hv=2004533713 ad='97219d80'
    alter session set events '10046 trace name context forever, level 12'
    END OF STMT
    EXEC #1:c=0,e=346,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=107123625473
    WAIT #1: nam='SQL*Net message to client' ela= 11 p1=1650815232 p2=1 p3=0
    WAIT #1: nam='SQL*Net message from client' ela= 6476024 p1=1650815232 p2=1 p3=0
    =====================
    PARSING IN CURSOR #1 len=37 dep=0 uid=0 oct=3 lid=0 tim=107130104260 hv=2246554324 ad='97c21958'
    select count(*) from dba_jobs_running
    END OF STMT
    PARSE #1:c=0,e=548,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=107130104237
    BINDS #1:
    EXEC #1:c=0,e=1412,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=107130106034
    WAIT #1: nam='SQL*Net message to client' ela= 12 p1=1650815232 p2=1 p3=0
    *** 2006-11-21 21:40:53.931
    FETCH #1:c=350760000,e=344612113,p=0,cr=2,cu=16652,mis=0,r=1,dep=0,og=4,tim=107474718456
    WAIT #1: nam='SQL*Net message from client' ela= 1936 p1=1650815232 p2=1 p3=0
    FETCH #1:c=0,e=6,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=107474721309
    WAIT #1: nam='SQL*Net message to client' ela= 8 p1=1650815232 p2=1 p3=0
    *** 2006-11-21 21:56:30.972
    WAIT #1: nam='SQL*Net message from client' ela= 915075702 p1=1650815232 p2=1 p3=0
    XCTEND rlbk=0, rd_only=1
    STAT #1 id=1 cnt=1 pid=0 pos=1 obj=0 op='SORT AGGREGATE (cr=2 r=0 w=0 time=100535896 us)'
    STAT #1 id=2 cnt=0 pid=1 pos=1 obj=0 op='NESTED LOOPS (cr=2 r=0 w=0 time=100535876 us)'
    STAT #1 id=3 cnt=5550 pid=2 pos=1 obj=0 op='MERGE JOIN CARTESIAN (cr=2 r=0 w=0 time=128639 us)'
    STAT #1 id=4 cnt=10 pid=3 pos=1 obj=0 op='NESTED LOOPS OUTER (cr=2 r=0 w=0 time=5839 us)'
    STAT #1 id=5 cnt=10 pid=4 pos=1 obj=69 op='FIXED TABLE FULL X$KSQRS (cr=0 r=0 w=0 time=4790 us)'
    STAT #1 id=6 cnt=10 pid=4 pos=2 obj=202 op='INDEX UNIQUE SCAN OBJ#(202) (cr=2 r=0 w=0 time=561 us)'
    STAT #1 id=7 cnt=5550 pid=3 pos=2 obj=0 op='BUFFER SORT (cr=0 r=0 w=0 time=90039 us)'
    STAT #1 id=8 cnt=555 pid=7 pos=1 obj=16 op='FIXED TABLE FULL X$KSUSE (cr=0 r=0 w=0 time=1277 us)'
    STAT #1 id=9 cnt=0 pid=2 pos=2 obj=0 op='VIEW (cr=0 r=0 w=0 time=344148954 us)'
    STAT #1 id=10 cnt=105477 pid=9 pos=1 obj=0 op='UNION-ALL (cr=0 r=0 w=0 time=343814331 us)'
    STAT #1 id=11 cnt=105476 pid=10 pos=1 obj=0 op='VIEW (cr=0 r=0 w=0 time=203487737 us)'
    STAT #1 id=12 cnt=105476 pid=11 pos=1 obj=0 op='UNION-ALL (cr=0 r=0 w=0 time=202961626 us)'
    STAT #1 id=13 cnt=0 pid=12 pos=1 obj=272 op='FIXED TABLE FULL X$KDNSSF (cr=0 r=0 w=0 time=13633786 us)'
    STAT #1 id=14 cnt=105476 pid=12 pos=2 obj=72 op='FIXED TABLE FULL X$KSQEQ (cr=0 r=0 w=0 time=188317145 us)'
    STAT #1 id=15 cnt=0 pid=10 pos=2 obj=253 op='FIXED TABLE FULL X$KTADM (cr=0 r=0 w=0 time=76301426 us)'
    STAT #1 id=16 cnt=1 pid=10 pos=3 obj=254 op='FIXED TABLE FULL X$KTCXB (cr=0 r=0 w=0 time=62693462 us)'
    STAT #1 id=16 cnt=1 pid=10 pos=3 obj=254 op='FIXED TABLE FULL X$KTCXB (cr=0 r=0 w=0 time=62693462 us)'
    <---- END of TRACE FILE -->

  • How do I execute "Select count(*) from table " in OCI

    Hi,
    I am new to OCI and so this question may seem stupid. I would like to know how to execute the query "select count(*) from <table>" using OCI V8 functionality? Also after how do I get the result into a integer datatype? I have gone through most of the demo programs but is is of little help to me.
    Thanks in advance...
    Regards,
    Shubhayan.

    Hi,
    Here is sample code to give you some idea how to do it. If you want some more info let me know.
    Pankaj
    ub4 count;
    // Prepare the statement.
    char szQry = "SELECT count() FROM T1";
    if(OCI_ERROR == OCIStmtPrepare(pStmthp, pErrhp, (unsigned char*)szQry, strlen(szQry), OCI_NTV_SYNTAX , OCI_DEFAULT) )
         cout << "Error in OCIStmtPrepare" << endl;
         exit(1);
    // Bind the output parameter.
    OCIDefine *pDefnpp;
    if(OCI_ERROR == OCIDefineByPos ( pStmthp, &pDefnpp, pErrhp, 1,
    &count, sizeof(ub4), SQLT_INT,
    (dvoid *) 0, (ub2 *) 0, (ub2 *) 0,
                        OCI_DEFAULT) )
         cout << "Error in OCIDefineByPos" << endl;
         exit(1);
    if(OCI_ERROR == OCIStmtExecute(pSvchp, pStmthp, pErrhp, 1, 0, NULL, NULL, OCI_DEFAULT) )
         cout << "Error in OCIStmtExecute" << endl;
         exit(1);

  • Is select count(*) correct way to find speed

    Environment I am using:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Toad 11.6
    In oracle in general, if i want to know how fast I can get data from a table (or a pipelined function), is select count(*) accurate way to do it ?
    Eg:
    select count(*) from table(schema_name.pkg_name.proc_name(paremter1 in 123 ))
    select count(*) from table(schema_name.pkg_name.proc_name(paremter1 in 123 ))
    or
    select count(*) from tableA
    so can i give above queries and note down the time, is this accurate way to know the fastness?

    In oracle in general, if i want to know how fast I can get data from a table (or a pipelined function), is select count(*) accurate way to do it ?
    There is no such thing as 'in general'.
    It all depends on 'what' data you want to get if you are querying a table and exactly how the function actually works if you are calling a function.
    A query that 'gets' one column very fast might take days to 'get' ALL columns.
    A function that does different queries based on the parameters might return data quickly for one parameter value and be very slow for a different parameter value.
    Start over and tell us what BUSINESS PROBLEM you are trying to solve.

  • Select * vs select count(*)

    I have 2 schemas within a database, one is an exact copy of the other. One of the views that has been created is behaving strangly.
    On schema 1:
    doing a "select * from view" lists all the records.
    doing a "select count(*) from view" gives the correct count of the records
    On schema 2:
    doing a "select * from view" lists all the records.
    doing a "select count(*) from view" gives a count of zero!
    Stats were gathered yesterday for both schemas so are not out of date (not much data has been inserted since).
    The above applies for Toad, sqlplus, isql, etc.
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production.
    Any ideas what could cause this?
    Thanks.

    Rows are returned from the sql.
    Select count(1) still returns a zero count and recreating the view has no effect.
    Putting a 'where' clause in the select does bring back a count, but the count is again different to the actual number of rows returned when doing a select *.

  • Select count(x) on a table with many column numbers?

    Hi all,
    i have a table with physical data with 850 (!!) colums and
    ~1 Million rows.
    The select count(cycle)from test_table Statement is very, very slow
    WHY?
    The select count(cycle)from test_table is very fast by e.g 10 Colums. WHY?
    What has the number of columns, to do with the SELECT count(cyle).... statement?
    create test_table(
    cycle number primary key,
    stamp date,
    sensor 1 number,
    sensor 2 number,
    sensor_849 number,
    sensor_850 number);
    on W2K Oracle 9i Enterprise Edition Release 9.2.0.4.0 Production
    Can anybody help me?
    Many Thanks
    Achim

    hi lennert, hi all,
    many thanks for all the answers. I�m not an Oracle expert.
    Sorry for my english.
    Hi Lennert,
    you are right, what must i do to use the index in the
    query? Can you give me a pointer of direction, please?
    Many greetings
    Achim
    select count(*) from w4t.v_tfmc_3_blocktime;
    COUNT(*) ==> Table with 3 columns (very fast)
    306057
    Ausf�hrungsplan
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 SORT (AGGREGATE)
    2 1 TABLE ACCESS (FULL) OF 'V_TFMC_3 _BLOCKTIME'    
    Statistiken
    0 recursive calls
    0 db block gets
    801 consistent gets
    794 physical reads
    0 redo size
    388 bytes sent via SQL*Net to client
    499 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    select count(*) from w4t.v_tfmc_3_value;
    COUNT(*)==> Table with 850 columns (very slow)
    64000
    Ausf�hrungsplan
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 SORT (AGGREGATE)
    2 1 TABLE ACCESS (FULL) OF 'V_TFMC_3 _VALUE'    
    Statistiken
    1 recursive calls
    1 db block gets
    48410 consistent gets
    38791 physical reads
    13068 redo size
    387 bytes sent via SQL*Net to client
    499 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed

  • "select count(*)" and "select single *" returns different result

    Good day!
    product version SAP ECC 6.0
    oracle10
    data transfers from external oracle db into customer tables using direct oracle db link
    sometimes I get case with different results from 2 statements
    *mytable has 10 rows
    *1st statement
    data: cnt type I value 0.
    select count( * ) into cnt from mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *cnt returns 10 - correct
    *2nd statement
    select single * from  mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *sy-dbcnt returns 0
    *sy-subrc returns 4 - incorrect, 10 rows are "invisible"
    but
    1. se16 shows correct row number
    2. I update just one row from "invisible" rows using se16 and 2nd statement returns correct result after that
    can not understand why
    thank you in advance.

    Thank you, Vishal
    but,
    general problem is that
    1. both statements have the same WHERE conditions
    2. 1st return resultset with data (sy-dbcnt=10), 2nd return empty dataset, but must return 1 in sy-dbcnt
    Yes, different meaning, you are right, but must 2nd must return 1, because of "select single *" construction, not 0.
    Dataset to process is the same, WHERE conditions are equal...
    I think the problem is that how ABAP interperets select count(*) and "select single *".
    Maybe "select count (*)" scans only PK from index page(s)? and "select single *" scans data pages? and something is wrong with that?
    I'm new in SAP and didn't find any SAP tool to trace dump of data and indexes pages with Native SQL.
    se16 shows all records.
    And why after simple manual update of just one record using se16 "select single *" returns 1?
    I've just marked one row to update, didn't change any data, then pressed "save".

  • Select count(*) statement in ABAP

    Hi,
    Im writing following statement in my Function module,
    select count(*) into l_count
    from user_master
    where username = l_username and
          process_type = processtype and
          password = oldpassword.
    And there is one entry in table user_master.
    But still, I'm getting l_count as zero..
    Can somebody help me with this.
    Regards,
    Amey

    select count(*) into l_count
    from user_master
    where username = l_username and
    process_type = processtype and
    password = oldpassword.
    Use group by option...
    Like this....
    select count(*) into l_count
    from user_master
    where username = l_username and
    process_type = processtype and
    password = oldpassword group by username.

  • Installed Sun studio 12.2. ran 'discover' command on C++ code.Gives warning

    Hi,
    I installed Sun studio 12.2. I compiled C++ code with C++ 5.11 compiler, and ran discover command as shown below:
    > #CC -g -O2 test.cpp
    > #discover -w - a.out
    > discover (warning): a.out will be analyzed in lite mode because it has no annotations. See discover documentation for compiler flag/OS recommendations
    I get the discover warning. After runnig discover command, I executed ./a.out. On cosole, only memory leaks will be displayed and no other error.
    Any reason why discover gives warning??????????????????
    Edited by: Archit on Apr 5, 2011 11:09 PM
    Edited by: Archit on Apr 5, 2011 11:10 PM
    Edited by: Archit on Apr 5, 2011 11:10 PM
    Edited by: Archit on Apr 5, 2011 11:13 PM

    Hi,
    What a woderful fix you have provided !!!!!!!!!!
    It really works.
    I tried running on Solaris 10 update 8. discover tool runs properly. Where as , the tool runs in lite mode on Solaris update 4.
    If possible , can you pint me to some links where I can this kind of info.?
    Thank you very much.

  • Select Count(*) from Sample_table - how to get the count using JDBC?

    Hi All,
    It would be glad if anyone could help me with this. The problem is that I have to get the 'count' of records selected from a arbitrary table say, 'sample_table'. Is that possible to form the SQL in JDBC as
    Select Count(*) from Sample_table
    and get the value of the count? If yes, how?
    Thanks in advance
    Prabz

    stmt = con.createStatement();
    ResultSet recordcnt_rs = stmt.executeQuery("Select Count (*) as record_ctr From Sample_table");
    recordcnt_rs.next();     
    record_ctr = recordcnt_rs.getInt("record_ctr");
    hope this helps.

Maybe you are looking for

  • Edit Field Names

    hi all i need to change the field names in Vendor Master for a particular Account Group where can i do them and how regards Sundeep Edited by: sundeepkumar on Mar 19, 2010 12:37 PM

  • Troubled over "enhance" function

    I always try the iPhoto auto enhance function with a "ok,what do you expect"-sort of attitude - until using the enhance function in Pages/keynote - colors suddenly perfect, picture just right. This troubles me - am I missing something? Or did Apple i

  • Transport settings

    Hi All, I plan to move my requests from BI development to quality, integration testing and then to production. We are using ECC and BI. My question is, what are the steps to follow for transportimg my requests.             I believe they are (for eg

  • What is the logic behind the list of default colors in the color tab of the score options in the project settings interface?

    I desperately want to know why each note is assigned it's particular color in the score tab of the projects settings interface... Was this done at random or is there some logic behind it all?  Einstein and Newton have completely different ideas about

  • .Aspx Form with Sharepoint workflow 2013

    Hi, I created an .Aspx form using Visual Studio 2012 instead of Infopath2013 form, this form is not related to any list or library.Is there a way that I can associate this form with SharePoint Designer workflow.I don't want to use visual studio workf