On Sunday, January 16, 2011 at 9:55 AM, Navaneeth.K.N wrote:

> Hello,
> 
> I have a database with a table named "symbols". This has the following schema.
> 
> CREATE TABLE symbols (type TEXT, pattern TEXT, value1 TEXT, value2
> TEXT, children INTEGER);
> 
> I am using the C API of Sqlite and my application inserts records into
> the above table. Everything is executed inside a transaction and if
> all looks good, application will commit the transaction.
> 
> Now after the DB file has been created, "select * from symbols;" shows
> all the records available. Consider I have patterns like "n" & "a". A
> select statement like "select * from symbols where pattern = 'n'"
> returns no records. Same thing happens if I do "select * from symbols
> where pattern = 'a'". But when I do "select * from symbols where
> pattern like 'n'" it returns the matching records. I am wondering why
> this is happening?
> 
> Please find the attached the database.
> 
> 




Attachments don't come through in the mailing list. You will have to show the 
actual data you are inserting. Most likely you have "invisible" characters such 
as space in the records. See what you get when you try the following query --


SELECT '/' || pattern || '/' AS p FROM symbols WHERE pattern LIKE 'n';




> 
> 
> Sqlite version - 3.7.4
> 
> Any help would be appreciated
> 
> -- 
> Navaneeth
> 
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 
> 




_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to