I'm reading a text file into an in-memory pysqlite table.  When I do a SELECT 
on the table, I get a 'u' in front of each returned row eg.

> (u'QB VII',)
> (u'Quackser Fortune Has a Cousin in the Bronx',)

I've checked the data being INSERT'ed into the table and it has no 'u'.

The second problem is that I'm using the LIKE operator to match a pattern 
against a string but am getting garbage results.  For example, looking for the 
characters q='dog' in each string the SELECT statement is as follows:

for row in con.execute("SELECT <column> FROM <table> WHERE <string> LIKE '%q%' 
limit 25"):
    print row

This doesn't work and I've tried other combinations without luck!  Any thoughts 
on the correct syntax for the LIKE?

Dinesh
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to