Search notes:

SQLite function: upper / lower

upper(t) and lower(t) returns the ASCII characters of t in upper or lowercase. The non ASCII characters (such as the ä, é) are returned unchanged. This is demonstrated in the following simple example:
create table tq84_tab (
   id   int primary key,
   val  text
);

insert into tq84_tab values (1, 'foo');
insert into tq84_tab values (2, 'Bar');
insert into tq84_tab values (3, 'BAZ');
insert into tq84_tab values (4, 'äÖé');
insert into tq84_tab values (5, 'üzz');

.mode column
.width 3 3 3 3

select
   id,
   val,
   lower(val) val_l,
   upper(val) val_u
from
   tq84_tab;
--
-- 1    foo  foo  FOO
-- 2    Bar  bar  BAR
-- 3    BAZ  baz  BAZ
-- 4    äÖé  äÖé  äÖé
-- 5    üzz  üzz  üZZ

select * from tq84_tab where val = upper(val);
--
-- 3    BAZ
-- 4    äÖé

select * from tq84_tab where val = lower(val);
--
-- 1    foo
-- 4    äÖé
-- 5    üzz
Github repository about-sqlite, path: /functions/upper-lower.sql

See also

functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758203971, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQLite/functions/upper-lower(78): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78