SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Mar 2002
    Location
    san francisco, ca USA
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how do i store db data part2

    upon further review, it looks like my code only works when I use the "like" command in SQL.

    the code..

    hstmt = DB_FetchPrev(hdbc, "Select ispcode from requests where firstname = 'john' and lastname like '%jones%'")

    while (DB_FetchNext(hstmt, sIspCode))
    print ("ISPCODE: {sIspCode}")

    output:
    ISPCODE: AWX0001245
    ISPCODE: AWX0001295
    ISPCODE: AWX0001853

    but when i take the "like" out of the sql query and just do a lastname = 'jones' I do not get a record at all

    I need for the code to only return one ispcode. It seems like silk does not even step into the while statement.

    Please help!


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

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do i store db data part2

    If it's not stepping into the while loop, it's because there's nothing in your data record to step into.

    By the construction of your SQL, I'd guess that the record is not just as "jones" in the database but is " jones" or "jones " (more likely the latter) in there. (Trailing space on the end in case you can't see that here.)

    With the "like" call, do a print of all the names with quotes around them so that you can see if there are leading or trailing spaces.

    - Dave

    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

 

 

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 07:20 PM.

Copyright BetaSoft Inc.