Re: Ensuring Text Is Quoted On Insertion
Adrian Klaver <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
On Monday 20 November 2006 04:21 pm, Rich Shepard wrote: > On Mon, 20 Nov 2006, Adrian Klaver wrote: > > Alright, looking at your original post I am going to assume > > pName,sName,rNo and rTxt map to the above strings. If that is the case > > then do cur.execute(insertStatement,(pName,sName,rNo,rTxt)) > > Adrian, > > That's what I have. But, that's not what I see with the python print > statement. However, now that I think about it, there's no reason to assume > they work the same way. Pysqlite will take each complete string and assign > it to the field in the database, regardless of how it looks on the console > with the print statement. > > I needed to have tested it live and not assumed the same behavior as the > print statement. My apologies. > > Rich Yeah, The print statement cleans up the quotes. If you want to see the raw string just do python>>>pName 'wetlands' Or if the variables are in a sequence i.e seq=(pName,sName,rNo,rtxt) do- for i in seq: i -- Adrian Klaver [email protected]