"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote > 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',)
The u is not part of the data its Python telling you that the string is Unicode. > The second problem is that I'm using the LIKE operator > to match a pattern against a string but am getting garbage > results. Can you be more specidic? Can you post the statement and the 'garbage'? > for row in con.execute( "SELECT <column> FROM <table> WHERE <string> LIKE '%q%' limit 25"): Is thios the actual string or have you put the placemarkers (<column> etc) in just for the post? You do realise that the things inside <> are intended to be replaced with the actual values from your database. Thus a realistic string would look like "SELECT Name FROM Person WHERE Name LIKE '%q%" Which would return all Names with q in them. HTH, -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor