1
votes

I´m migrating a database from SQLITE to Firebird, but now my query doesn't work.

What am I doing wrong? Is there a reason?

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();
1
No only filter avething Like if i have a letter " abcd" i write A and don`t filter it i Write C it will filter. NOMECLIENTE VARCHAR(80), - ml.
"my query don't work" is not a useful problem description. Please edit your question and explain how it does not work. Do you get the wrong results? Do you get an error? If you want help in solving a problem, explain the problem you're having specifically. - Ken White
And if you write the same query (filling in the parameter) in your management tool, does it give you the results that you expect ? Anyway, I would not personally choose Firebird these days (if ever). - TLama
Hi the problem is : Searching for : "El Corte Inglés" if i writte "el" will return nothing if i writte "El" or "Co" it will returne the datarecord. is there a way to seach if it is captal or not? - ml.

1 Answers

2
votes

Firebird dose not support case insensitive queries.

Query_Case_Insensitive.html

Consider these options

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'

Equals (=) and *like * both perform case sensitive matches
*containing * is case insensitive, but will also match 'abcd'
upper() works, but will not use an index and, therefore, will read every record in the table
Equals (=) is the fastest because it uses an index (if available)