#!/home/ingres/clach04/wip/zope/Zope-2.6.4rc2-linux2-x86/bin/python #!python ## ~/clach04/wip/zope/Zope-2.6.4rc2-linux2-x86/bin/python import ingmod as sqlsession DB = "clach04" DB2 = "iidbdb" con = sqlsession.connect(DB) cur = con.cursor() cur.execute( "select table_name, table_owner from iitables where table_name like '%s%%'" % 'iitables') # fetchall not implemented in Ingres!!!! #print cur.fetchall() row = cur.fetchone() while row: print row row = cur.fetchone() # transaction commit/rollback/nothing has no impact on generated error #con.rollback() #con.commit() con2 = sqlsession.connect(DB2) cur2 = con2.cursor() cur2.execute("select name, own from iidatabase where own != '$ingres'") # fetchall not implemented in Ingres!!!! row = cur2.fetchone() while row:
#!/home/ingres/clach04/wip/zope/Zope-2.6.4rc2-linux2-x86/bin/python #!python ## ~/clach04/wip/zope/Zope-2.6.4rc2-linux2-x86/bin/python import ingmod as sqlsession DB = "clach04" sqlsession.verbose(1) sqlsession.debug(turnon = 1) con=sqlsession.connect(DB) cur=con.cursor() cur.execute("select table_name, table_owner from iitables where table_name like '%s%%'" % 'iitables') # fetchall not implemented in Ingres!!!! #print cur.fetchall() row = cur.fetchone() while row: print row row = cur.fetchone() # transaction commit/rollback/nothing has no impact on generated error #con.rollback() #con.commit()
end = self._size else: end = self._pos + maxsize sobj = self._str[self._pos:end] self._pos = end return sobj return None def data(self): return self._str #ingmod.debug(0) #ingmod.verbose(0) print dir(ingmod) cn1 = ingmod.connect(DB) print cn1.__doc__, dir(cn1) cu1 = cn1.cursor() print cu1.__doc__, dir(cu1) cn2 = ingmod.connect(DB) cu2 = cn2.cursor() cu2.arraysize = 24 cu2.execute( "select tid,reltid,relid,relatts from iirelation where reltid = 33") #cu2.execute("select tid,reltid,relid,relatts from iirelation") print "rowcount =", cu2.rowcount, "arraysize =", cu2.arraysize print cu2.description t = cu2.fetchone() while t: print t t = cu2.fetchone()