Results 1 to 6 of 6
  1. #1
    Join Date
    May 2009
    Posts
    12

    Unanswered: How to find rowcount in DB2

    Hi all
    Could you please provide me the query for rowcount in DB2

    Regards
    Vishal

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    you mean select count(*) ..
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    get diagnostics
    for no of rows impacted in last ins/upd/del
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  4. #4
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Code:
    D:\Script>db2 -a "update employee set hiredate = hiredate + 1 day where workdept = 'D21'"
    
    SQLCA Information
    
     sqlcaid : SQLCA     sqlcabc: 136   sqlcode: 0   sqlerrml: 0
     sqlerrmc:
     sqlerrp : SQL09053
     sqlerrd : (1) 0                (2) 0                (3) 7
               (4) 0                (5) 0                (6) 0
     sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)
               (7)      (8)      (9)      (10)       (11)
     sqlstate: 00000
    7 rows are updated. this can be derived from the 3rd occurence of sqlerrd.

  5. #5
    Join Date
    May 2009
    Posts
    12
    I mean......I have to select first two rows from a table.In oracle we can do this like:-->

    select * from emp where rownum<=2

    How can i achive above query in DB2??

    Regards
    Vishal

  6. #6
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    select .. fetch first 2 rows only
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •