nasihere / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Check for empty record fails #344

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. This query in pyodbc fails (finds no records)
cursor.execute('SELECT Record, Cue '
               'FROM Songs '
               'WHERE Cue IS NOT NULL '
               "AND Cue <> '' "
               'ORDER BY Record')
2. This query in MS Access works:
SELECT Record, Cue
FROM Songs
WHERE Cue IS NOT NULL
AND Cue <> ''
ORDER BY Record;

3. The Cue field is Long Text, containing XML.

What is the expected output? What do you see instead?

I expect 1849 records. I see 0.

What version of the product are you using? On what operating system?
Python 2.7 pyodbc-3.0.7 on windows 8 64 bit, but using 32 bit python

Original issue reported on code.google.com by Doug.Cl...@gmail.com on 24 Oct 2013 at 5:08

GoogleCodeExporter commented 8 years ago
I have encountered the same problem but after some testings, I am not convinced 
it is pyodbc's fault.

I am running Python 2.7.5 pyodbc-3.0.7 on CentOS 6.4 
and had a query return zero rows when it shouldn't but I also ran the same test 
with 
Psycopg2 and the same happened after an equal period of runtime (not the cause).

Problem is I'm querying against PostgreSQL-9.2.

I am baffled.

Original comment by Lord.C...@gmail.com on 4 Feb 2014 at 4:53