Menu

Select query returns nothing

gman
2009-10-05
2013-04-29
  • gman

    gman - 2009-10-05

    I'm running a query that should return at least 20000 rows. The query returns the whole of them when I run the query on a small test script, but returns nothing when I run it in my full app. The connection parameters are the same on both scripts and the query is a simple select:

    select cola, colb, colc, cold from sometable where create_date >= '2009-01-01'

    On my full app I'm executing other select queries to fetch data for local use/storage. The queries that have no where conditions are always successful, but the two that have the where clause with the date condition return nothing and no reason is given or exception is raised. Successful queries are executed before and after the troublesome queries with where clauses.

    When I take either query out and run it on SSMS it runs perfectly. The same happens when I run either query on a test script.

    If i make another connection in my full app and run the queries through it the queries return the rows I want, but I shouldn't have an open connection per query.

    I'm truly baffled…

    pymssql version 1.0.2 on Debian and Windows (same results on both)

     
  • gman

    gman - 2009-10-05

    Nevermind, it seems the parameters were actually different. Doh!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.