Firebird Case-Insensitive Searching 大小写不敏感查找
原文:https://www.cnblogs.com/jonney-wang/p/9654944.html
Firebird 默认是大小写敏感,在检索的时候。
要想不敏感检索,两种方法:
1、where upper(name) = upper(:flt_name)
2、检索时指定字符集collation,例如:collate unicode_ci
select * from M_CUSTOMER where 字段名 collate unicode_ci = 'c0001'
实际存储code = C0001
或者在创建表时,把collation设置为: unicode_ci
这时在查询时大小写不敏感。
CREATE TABLE "T1" (
"id" integer NOT NULL PRIMARY KEY,
"n1" varchar(254) COLLATE UNICODE_CI,
"n2" varchar(254)
)
参考:
sql - Firebird configuration - turn case-sensitivity off - Stack Overflow