J Trahair <j.trah...@foreversoftware.co.uk> wrote:
> Hi. I've noticed that SELECT statements are specific to the capitalisation of 
> the WHERE section.
> 
> Suppose I have a Customers table with a CustomerCode field, and a value in 
> one of the records of TRA001, eg:
> 
> CustomerCode   CustomerName
> TRA001             Trahair
> SMI001              Smith
> 
> If the SELECT statement is SELECT * FROM Customers WHERE CustomerCode = 
> 'tra001' that is, with tra001 in lower case, SQLite *does
> not find the record*. 
> 
>Is there a setting I can change so that SQLite SELECT statements are not case 
>specific? 

create table Customers (CustomerCode text collate NOCASE, CustomerName text);

Now all comparisons on CustomerCode will be case-insensitive by default. If you 
want that in specific SELECT statement instead, you can write

SELECT * FROM Customers WHERE CustomerCode = 'tra001' collate NOCASE;

-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to