Re: pymssql - execute loads all results into memory!

2008-10-21 Thread ChaosKCW
On Oct 20, 3:38 pm, Tim Golden <[EMAIL PROTECTED]> wrote: > Eric Wertman wrote: > >> I am trying to use pymssql, and have an issue where by the execute > >> (not the fetch) is appearing to load all records into memory. > > >> if I execute > > >> con = pymssql.connect(...) > >> cur = con.cursor() >

pymssql - execute loads all results into memory!

2008-10-20 Thread ChaosKCW
Hi I am trying to use pymssql, and have an issue where by the execute (not the fetch) is appearing to load all records into memory. if I execute con = pymssql.connect(...) cur = con.cursor() cur.execute(sql) rec = cur.fetchone() if I put in a query which returns a lot of records into "sql" the

Re: FTP (ftplib) output capture

2006-08-01 Thread ChaosKCW
Hi Thanks for the reply. I will send it in when I am done :-) Simon Forman wrote: > ChaosKCW wrote: > > Hi > > > > Has anyone caputerd the output from the std ftp lib? It seems a bit > > annoying that everything is printed to stdout. It means incorporating > >

FTP (ftplib) output capture

2006-07-31 Thread ChaosKCW
Hi Has anyone caputerd the output from the std ftp lib? It seems a bit annoying that everything is printed to stdout. It means incorporating this into any real program is a problem. It would have been much better if they used the std logging module and hooked up a console logger for the feault ftp

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-10 Thread ChaosKCW
> > When python tries to concatenate a byte string and a unicode string, it > assumes that the byte string is encoded ascii and tries to convert from > encoded ascii to unicode. It calls ascii decoder to do the decoding. If > decoding fails you see message from ascii decoder about the error. > >

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-10 Thread ChaosKCW
> > There's an Oracle environment variable that appears to make a > difference: NLS_CHARSET, perhaps - it's been a while since I've had to > deal with Oracle, and I'm not looking for another adventure into > Oracle's hideous documentation to find out. > That is an EVIL setting which should not be

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-10 Thread ChaosKCW
Roger Binns wrote: > > No. APSW converts it *to* Unicode. SQLite only accepts Unicode > so a Unicode string has to be supplied. If you supply a non-Unicode > string then conversion has to happen. APSW asks Python to > supply the string in Unicode. If Python can't do that (eg > it doesn't kno

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-04 Thread ChaosKCW
Hi Thanks for all the posts. I am still digesting it all but here are my initial comments. >Don't. You can't. Those characters don't exist in the ASCII character set. >SQLite 3.0 deals with UTF-8 encoded SQL statements, though. >http://www.sqlite.org/version3.html As mentioned by the next poster

Convertion of Unicode to ASCII NIGHTMARE

2006-04-03 Thread ChaosKCW
Hi I am reading from an oracle database using cx_Oracle. I am writing to a SQLite database using apsw. The oracle database is returning utf-8 characters for euopean item names, ie special charcaters from an ASCII perspective. I get the following error: >SQLiteCur.execute(sql, row) >UnicodeDe

Grabbing a object from the current code block using a callable statement?

2006-02-25 Thread ChaosKCW
Hi Is it possible to grab get an object returned from a string and a callable ? e.g I pass in a key value pair: def somemethod(adict = {'new name for object': ''}): object = . for key, value in adict.items(): if callable(value): somedict[key] = value() else:

Re: Import statements for timeit module

2005-11-11 Thread ChaosKCW
So timeit is mostly useless then ? -- http://mail.python.org/mailman/listinfo/python-list

Import statements for timeit module

2005-11-11 Thread ChaosKCW
Hi I was wondering if someone could help with the import statements needed to use the timeit module in the following code. I need to access the "cur" object. Thanks, import cx_Oracle import timeit def VerifyTagIntegrity(con, TableOwner): cur = con.cursor() sql = 'select (select count(*)

Re: Geneator/Iterator Nesting Problem - Any Ideas? 2.4

2005-03-07 Thread ChaosKCW
For those that are interested I ran a performance comparison of various functions for wrapping sql results in a interables and generators. The results are below and the code is at the very bottom. Surprisinly (in a happy way) the functional version of the batch retrieve comes in a very close secon

Re: Geneator/Iterator Nesting Problem - Any Ideas? 2.4

2005-03-04 Thread ChaosKCW
Hi Thanks this was very helpfull. Your final solution seems like the best (most elegant). I was trying to avoid the ugly while loops with breaks and this final one certainly does that. Thanks for your help . -- http://mail.python.org/mailman/listinfo/python-list

Geneator/Iterator Nesting Problem - Any Ideas? 2.4

2005-03-04 Thread ChaosKCW
Hi Using Python 2.4 I am trying to procduce a generator which will return the results of dbi SQL statement using fetchmany for performance. So instead of fetching one record for each call, I will fetch batches of X (eg 100) and yeild each record in turn. For reasons of pure asthetics and my own