‎2007 Feb 28 3:34 PM
I am assuming this is basically use for finding the number of entries in a DB table...any other comon uses?
Should sy-dbcnt be checked when using this?
Thank-You
‎2007 Feb 28 3:38 PM
HI Tom,
Yes, that is its primary usage. To be precise, it gives the number of matches for the current where clause.
no need to check. It essentially does the same.
Regards,
Ravi
‎2007 Feb 28 3:37 PM
SY-DBCNT will give u no of entries return by your select statement, if u put select * the sy-dbcnt will contain how many entries in DB table.
‎2007 Feb 28 3:38 PM
‎2007 Feb 28 3:38 PM
Hi,
Sy-Dbcnt is used only for count the total no of records in db table.
No,
not for any orther uses.
Regards,
Sreevani
‎2007 Feb 28 3:38 PM
Hello TOM,
<b>SY-DBCNT - DB operations, number of table lines processed</b>
Vasanth
‎2007 Feb 28 3:38 PM
HI Tom,
Yes, that is its primary usage. To be precise, it gives the number of matches for the current where clause.
no need to check. It essentially does the same.
Regards,
Ravi
‎2007 Feb 28 3:40 PM
So checking sy-dbcnt is same as COUNT.
So my basic question is still what would I use COUNT for?
‎2007 Feb 28 3:42 PM
Hi
Sy-dbcnt will give the no. of records fetched from the database.
i.e Number of <b>processed table rows</b>
SY-DBCNT
SQL statements set the content of SY-DBCNT to the number of database lines processed. With SELECT loops in Open SQL, SY-DBCNT is set after the ENDSELECT statement. In Native SQL, SY-DBCNT is set after the ENDEXEC statement.
DELETE sets SY-DBCNT to the number of lines deleted.
FETCH sets SY-DBCNT to the number of lines already read by the current cursor.
INSERT sets SY-DBCNT to the number of lines inserted.
MODIFY sets SY-DBCNT to the number of lines processed.
UPDATE sets SY-DBCNT to the number of lines changed.
COUNT
<b>count</b> gives the total number of records present in the database table
Apart from that no other use as such
Hope this clears your doubt.
reward if useful
Regards,
Saumya
‎2007 Feb 28 3:48 PM
Hi,
count Returns the number of lines selected.
sy-dbcnt DB operations, number of table lines processed
Regards,
Sruthi
‎2007 Feb 28 3:53 PM
Saumya, Thanks you say..count gives the total number of records present in the database table, Apart from that no other use as such.
Where does it give the total no of records? in sy-dbcnt, because I check this without using COUNT.
Thanks everybody all feedback is appreciated.
‎2007 Feb 28 4:08 PM
Hi Tom,
Finally u got a answer, example. Count function u can use for particular col name.
SELECT COUNT( CARRID )
INTO COUNT FROM SPFLI
WHERE
CITYTO = 'NEW YORK'.
WRITE: / COUNT.
For performance concern not advaisable to use COUNT statement.