By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

mxODBC problems

P: n/a
I have just installed mxODBC on my x86_64 suse linux machine, where I
use unixODBC for connection. Running queries from isql or DataManager
works fine for the DSN that I am using. However, under mxODBC, I can
get a connection object and a cursor object, but all attempts to
execute even the simplest selects result in empty resultsets. Any
ideas on what might be wrong?
>>from mx.ODBC.unixODBC import *
con = connect('Postgresql',user='username',password='pas swd')
cur = con.cursor()
cur.execute('SELECT * FROM g_rif')
rs = cur.execute('SELECT * FROM g_rif')
rs
cur.execute('SELECT * FROM g_rif').fetchall()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'fetchall'

Thanks,
Sean

Jan 9 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sean Davis wrote:
I have just installed mxODBC on my x86_64 suse linux machine, where I
use unixODBC for connection. Running queries from isql or DataManager
works fine for the DSN that I am using. However, under mxODBC, I can
get a connection object and a cursor object, but all attempts to
execute even the simplest selects result in empty resultsets. Any
ideas on what might be wrong?
>>>from mx.ODBC.unixODBC import *
con = connect('Postgresql',user='username',password='pas swd')
cur = con.cursor()
cur.execute('SELECT * FROM g_rif')
rs = cur.execute('SELECT * FROM g_rif')
rs
cur.execute('SELECT * FROM g_rif').fetchall()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'fetchall'

Thanks,
Sean
I think you will find that there result returned by the
cur.execute is None upon success. You probably meant:

cur.execute('SELECT * FROM g_rif')
table=cur.fetchall()

Then process table.

-Larry
Jan 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.