SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Member
    Join Date
    Nov 2000
    Location
    Tampa, FL USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    DB_FetchNext not getting information from database

    We are using DB_FetchNext to fetch rows of data out of a DB2 database right after the record is written. This Function is in a loop that reads a csv file inputs the information into the Web page. The web page saves the data to the database. After each save we take the ODBID, connect to db2, login and pull the information from the database. Then we compare what was input to what was pulled from the db, and disconnect from the database. This works fine for the first record we pulled from the dB, but when we reconnect and do the DB_FetchNext for the second record we are getting nothing returned from db2. (all fields are <unset> and no error is returned). We only want the first record each time we query the db that is why we do a connect & disconnect upon each input record.
    Any ideas on why we are getting blank (empty) data back from subsequent DB_FetchNext calls???? We searched this forum but found nothing that pertains to such a problem .
    We are using SilkTest 5.5, Win2K, IE5.5, DB2 Client V 7.

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

  2. #2
    Junior Member
    Join Date
    Jul 2001
    Location
    Austin, Tx
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_FetchNext not getting information from database

    Is this all in a big for loop?

    ------------------
    The Stumbinator
    The Stumbinator

  3. #3
    Member
    Join Date
    Nov 2000
    Location
    Tampa, FL USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_FetchNext not getting information from database

    It is a while loop....while not at the end of the file.

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

  4. #4
    Member
    Join Date
    Nov 2000
    Location
    Tampa, FL USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_FetchNext not getting information from database

    It is a while loop....while not at the end of the file.

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

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

    Re: DB_FetchNext not getting information from database

    Have you checked that the data really is being saved, and is accessible to some other odbc client?

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

  6. #6
    Member
    Join Date
    Nov 2000
    Location
    Tampa, FL USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_FetchNext not getting information from database

    Yes the data is being saved. We can go out and do a connect thru UDB Agent, outside SilkTest, and query the information.

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

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

    Re: DB_FetchNext not getting information from database

    How are you managing to just retrieve the first row of the database? How does disconnecting and reconnecting help this?

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

  8. #8
    Member
    Join Date
    Nov 2000
    Location
    Tampa, FL USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_FetchNext not getting information from database

    we are searching for a specific row (ODBID) in the database which is the row of data that was just added.

    We feed the query to a string value of MyQuery to get the ODBID into the SQL statement

    Here is the query.

    STRING MyQuery = "SELECT t1.first_name, t1.last_name, t1.mi_name, t1.phone, t1.tie_line, t1.home_phone, t1.wireless_phone, t1.fax_number, t1.pager, t1.pin, t1.email, t1.job_title, t1.id FROM nc3.person t1 WHERE " + STR (PerKey) + " = t1.odbid"

    STR (PerKey) is the ODBID of the record that was just added to the database on the web panel. After a person saves the data the ODBID is returned on the panel. We extract the ODBID...Yes we are getting the correct one.. and feed it into the query.
    We open the connection before the query and close it after each query.
    ------------------


    [This message has been edited by janek (edited 11-05-2001).]

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

    Re: DB_FetchNext not getting information from database

    After each time you reconnect, you are calling DB_ExecuteSql before calling DB_FetchNext aren't you?

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

  10. #10
    Member
    Join Date
    Nov 2000
    Location
    Tampa, FL USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_FetchNext not getting information from database

    Yes we are doing in this order
    DB_Connect
    DB_ExecuteSql
    DB_FetchNext
    DB_FinishSQL
    DB_Disconnect

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

 

 
Page 1 of 2 12 LastLast

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 09:25 AM.

Copyright BetaSoft Inc.