Re: [pysqlite] Exporting Data to .CSV file
"Nuno Ribeiro" <[email protected]> Fri, 28 Nov 2008 23:55:45 +0000
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
>> " So if I understand this, CSV was not intended to /be/ the product of the processing -- you just thought you needed it to get the data into a format you could manipulate from Python? " Yes and no :) I will try to explain. It is true that I thought I needed to have .CSV file to get in a format I could manipulate from Python. Fortunately, there's no need to as you gratefully explained back. Though, it might be interesting to query the Database for certain records and save those records in a format that can be easily converted to an EXCELL(.xls) or CALC (.ods) file. But, it doesn't have to be strictly a .CSV. As an example, if I could manipulate Data from Python and write it - as string - in an .ODS file (using ooolib) maybe .CSV is not needed. >> "You've already seen, in my sample, retrieval of data from an SQLite3 database; insertion/update is similar using .execute() or .executemany() (make sure you read up on parameterized queries <G>)" Yes, and it's very Helpful!:) It was nice to get some advice from experienced people. Sometimes it's not que amount of info we read, but the QUALITY we read and the way we GET (interpret) information. Thanks again! On Fri, Nov 28, 2008 at 8:44 PM, Dennis Lee Bieber <[email protected]>wrote: > On Fri, 28 Nov 2008 18:57:56 +0000, "Nuno Ribeiro" > <[email protected]> declaimed the > following in gmane.comp.python.db.pysqlite.user: > > > Thanks a lot for your help guys! I mixed many things and that was a bad > > behaviour. I asked about a CSV import/export because I wanted to treat > Data > > through Python and from Python. And I didn't understand not only how to > get > > Data from SQLIte but also how to manipulate that Data from Python. > > > > So if I understand this, CSV was not intended to /be/ the product > of > the processing -- you just thought you needed it to get the data into a > format you could manipulate from Python? > > If true, then you can ignore the csv module and do everything > directly within Python. > > You might want to start with > http://www.python.org/dev/peps/pep-0249/ which is the document > describing the dbapi2 interface in general (that is, it does not rely > upon any single database engine). Then move on to the pysqlite > equivalent, which should point out where SQLite3 differs from the > generic model. > > You've already seen, in my sample, retrieval of data from an SQLite3 > database; insertion/update is similar using .execute() or .executemany() > (make sure you read up on parameterized queries <G>) > -- > Wulfraed Dennis Lee Bieber KD6MOG > [email protected] [email protected] > HTTP://wlfraed.home.netcom.com/ > (Bestiaria Support Staff: [email protected]) > HTTP://www.bestiaria.com/ > > _______________________________________________ > list-pysqlite mailing list > list-pysqlite-FR6EJeJVuqdwc357pe9rcyQmJico6nz3epZhswDD4dQ@public.gmane.org > http://itsystementwicklung.de/cgi-bin/mailman/listinfo/list-pysqlite > _______________________________________________ list-pysqlite mailing list list-pysqlite-FR6EJeJVuqdwc357pe9rcyQmJico6nz3epZhswDD4dQ@public.gmane.org http://itsystementwicklung.de/cgi-bin/mailman/listinfo/list-pysqlite