SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    207
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do i get the record count of a table? my silk app GFPs

    I want to get the list of row count in a table. I use the foll:-

    String query = "select count(*) from table_name"
    hstmt = DB_ExecuteSql(hdbc,query)

    where table_name is a valida table
    The above statement causes silk5.0.2 to GPF .....
    is there any way i can get the row count in a table using silk

  2. #2
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do i get the record count of a table? my silk app GFPs

    We had this problem for a while, when connecting to an Oracle database; the problem just disappeared on us (without having taken sufficient notice of which version of silktest we were on). Right now we're on 5.0.3, and haven't had any problems with count(*) (or any of the aggregate functions in sql), so it is worth upgrading to see if it sorts it out for you as well.

    In the meantime, you could try getting a list of values and doing ListCount on it, to get the same result you would have got using count(*).

    ------------------

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do i get the record count of a table? my silk app GFPs

    I have not seen this problem, but it seems like an ODBC driver issue. What database are you connecting to ? You might change from the Microsoft driver an Oracle driver or vice versa.

    ------------------
    Rob Kapteyn
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  4. #4
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do i get the record count of a table? my silk app GFPs

    Make sure that the version of ODBC driver that you are using supports that statement. You may have to try specifically naming the column to count rather than using *

    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

  5. #5
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do i get the record count of a table? my silk app GFPs

    As an alternative, you could just select some small field from the table, then count the records you get back.

    Example

    sSQL = "select id from table_name"

    LIST OF ANYTYPE la
    ANYTYPE a

    while (DB_FetchNext (hSQL, a))
    ListAppend (la, a)

    return ListCount (la)


    Hope this helps.


    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

  6. #6
    Senior Member
    Join Date
    Jul 2001
    Posts
    207
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do i get the record count of a table? my silk app GFPs

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by John Green:
    As an alternative, you could just select some small field from the table, then count the records you get back.

    Example

    sSQL = "select id from table_name"

    LIST OF ANYTYPE la
    ANYTYPE a

    while (DB_FetchNext (hSQL, a))
    ListAppend (la, a)

    return ListCount (la)


    Hope this helps.


    <HR></BLOCKQUOTE>

    John Thanks a lot.
    The work around helped...it is not optimised workaround but it is doing the job for me and i am not concerned with optimization righ now.

    ------------------

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:34 AM.

Copyright BetaSoft Inc.