查询过滤器 delphi firedac Firebird 数据库
Query filter delphi firedac Firebird database
我正在将数据库从 SQLITE 迁移到 Firebird,但现在我的查询不起作用。
我做错了什么?有什么原因吗?
frmDados.Clientes.Close();
frmDados.Clientes.SQL.Text :=
'SELECT * FROM CLIENTES ' +
'WHERE (nomecliente like :d1) '+
'order by nomecliente asc';
frmDados.Clientes.Params.ParamByName('d1').AsString := '%' + Edit1.text + '%';
frmDados.Clientes.OpenOrExecute();
Firebird 不支持不区分大小写的查询。
考虑这些选项
select * from "abc_table" where "Some_Field" = 'Abc'
select * from "abc_table" where "Some_Field" like 'Abc'
select * from "abc_table" where "Some_Field" containing 'Abc'
select * from "abc_table" where upper("Some_Field") = 'ABC'
等于 (=) 和 *like * 都执行区分大小写的匹配
*containing * 不区分大小写,但也会匹配 'abcd'
upper() 有效,但不会使用索引,因此会读取 table
中的每条记录
等于 (=) 是最快的,因为它使用索引(如果可用)
我正在将数据库从 SQLITE 迁移到 Firebird,但现在我的查询不起作用。
我做错了什么?有什么原因吗?
frmDados.Clientes.Close();
frmDados.Clientes.SQL.Text :=
'SELECT * FROM CLIENTES ' +
'WHERE (nomecliente like :d1) '+
'order by nomecliente asc';
frmDados.Clientes.Params.ParamByName('d1').AsString := '%' + Edit1.text + '%';
frmDados.Clientes.OpenOrExecute();
Firebird 不支持不区分大小写的查询。
考虑这些选项
select * from "abc_table" where "Some_Field" = 'Abc'
select * from "abc_table" where "Some_Field" like 'Abc'
select * from "abc_table" where "Some_Field" containing 'Abc'
select * from "abc_table" where upper("Some_Field") = 'ABC'
等于 (=) 和 *like * 都执行区分大小写的匹配
*containing * 不区分大小写,但也会匹配 'abcd'
upper() 有效,但不会使用索引,因此会读取 table
中的每条记录
等于 (=) 是最快的,因为它使用索引(如果可用)