[Ironpython-users] DataSet --> SQLite

Sven Thomas Sven.Thomas at prov.ca
Fri Mar 16 17:23:13 CET 2012


Thanks.  

So far I've worked out a solution iterating through the dataset.  It's
slow and the hard drive pins, but this report is only intended to be run
once a year so performance isn't exactly a priority:

<code>
	for i in range(self.oraData2.Tables[0].Rows.Count -1):
		title = self.oraData2.Tables[0].Rows[i][0]
		bcode =  self.oraData2.Tables[0].Rows[i][1]
		callno = str(self.oraData2.Tables[0].Rows[i][2])
		stat1 = str(self.oraData2.Tables[0].Rows[i][3])
		stat2 = str(self.oraData2.Tables[0].Rows[i][4])

		(prep and execute SQL)
</code>

I'm on a bit of a timeline with this project before the end of the
semester so I'll explore a more performance friendly method once our
library gets underway with this version.

To be honest; System.Data.SQLite wasn't working because I've no idea how
to do it!  :0  I kept translating code examples from VB and C# but it
didn't work.  I'm sure it can be done quite well, I'm just a little too
green on the subject.  :)

- Sven


  >  -----Original Message-----
  >  From: Jeff Hardy [mailto:jdhardy at gmail.com]
  >  Sent: March-16-12 10:49 AM
  >  To: Vernon Cole
  >  Cc: Sven Thomas; ironpython-users at python.org
  >  Subject: Re: [Ironpython-users] DataSet --> SQLite
  >  
  >  On Wed, Mar 14, 2012 at 3:34 PM, Vernon Cole
  >  <vernondcole at gmail.com> wrote:
  >  > I would suggest opening both databases in their native form, then
do
  >  > the comparison using Python code rather than a complex SQL query.
It
  >  > may take a while to run, but should work okay. SQLite select
statements
  >  are quite fast.
  >  > Trying to do the whole thing in one swallow may be too much.
Better to
  >  > do lots of querys sequentially and build your result set as you
go.
  >  
  >  I agree with Vernon, but of course it depends on the operations you
need
  >  to do.
  >  
  >  You'll need to provide a little more information about why
  >  System.Data.SQLite isn't working for you. You could also try
2.7.2's
  >  sqlite3 support, which is more Pythonic.
  >  
  >  - Jeff


More information about the Ironpython-users mailing list