ODBC Database illegal operation
ryzam at my-deja.com
ryzam at my-deja.com
Tue Nov 14 03:09:41 EST 2000
Hi all
i'm getting error 'illegal operation' when making 2 times or more sql
select stament in my python programming.I'm using dbi/odbc from
pythonwin and my database is oracle database.If i using python IDLE
and making more tahan 3 sql it's not happen.
Simple example
import dbi
import odbc
class connect:
def __init__(self,dsn,login,passwd):
self.dsn=dsn
self.login=login
self.passwd=passwd
self.doConnect=self.dsn+'/'+self.login+'/'+self.passwd
self.con=odbc.odbc(self.doConnect)
self.createCursor()
def createCursor(self):
self.cur=self.con.cursor()
def createStatment(self,bil,stm=''):
self.bil=bil
if stm=='':
stm="""
select a.account_no,b.tmm_account_cat,
b.tmm_outlet_code, d.last_name from account_t a,
tmm_profile_account_t b, profile_t c,
account_nameinfo_t d where
c.account_obj_id0=a.poid_id0 and
d.obj_id0=a.poid_id0 and c.poid_id0=b.obj_id0
"""
self.createQuery(stm,self.bil)
def createQuery(self,stm,bil):
self.bil=bil
self.cur.execute(stm)
if self.bil=='p1':
self.p1=self.cur.fetchall()
print self.p1
elif self.bil=='p2':
self.p2=self.cur.fetchall()
print self.p2
else:
self.p3=self.cur.fetchall()
print self.p3
if __name__ =='__main__':
p=connect('CSDTEST1','test','test')
p.createStatment('p1',"""
select * from account_phone
""")
p.createStatment('p2','select address from account_names_t')
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list