Subject Incremental search problem
Author

Another issue, that came up with the update from IBO4.8 to IBO5.9 is a another problem with incremental search.


I have a table with several integer fields and a computed field from that integer fields and the computed field is a varchar field. Then I want to be able to display the computed field in a grid and to search incrementally by that field, but have the data sorted by the values of the integer fields. That worked well in IBO 4.8, but doesn't work any more in 5.9.


Here is an example.


The table is created that way:


create table test

(id integer not null primary key,

 field1 integer,

 field2 integer,

 field3 integer,

 field4 computed by (cast (field1 as varchar (10)) || '/' || cast (field2 as varchar (10)) || '-' || cast (field3 as varchar (10))))^


insert into test (id, field1, field2, field3)

values (1, 1, 1, 1)^

insert into test (id, field1, field2, field3)

values (2, 2, 2, 2)^

insert into test (id, field1, field2, field3)

values (3, 3, 3, 3)^

insert into test (id, field1, field2, field3)

values (4, 4, 4, 4)^

insert into test (id, field1, field2, field3)

values (5, 5, 5, 5)^

insert into test (id, field1, field2, field3)

values (6, 6, 6, 6)^

insert into test (id, field1, field2, field3)

values (7, 7, 7, 7)^

insert into test (id, field1, field2, field3)

values (8, 8, 8, 8)^

insert into test (id, field1, field2, field3)

values (9, 9, 9, 9)^

insert into test (id, field1, field2, field3)

values (10, 10, 10, 10)^


commit^


Then I place a TIB_Connection, TIB_Transaction, TIB_Query, TIB_DataSource and a TIB_Grid on a form, connect everything together and set the TIB_Query like that:

IB_Query.sql.text := 'select field4 from test';
IB_Query.keylinks.Text := 'id=id';

// I need the data to be ordered by the integer values, but be able to incremental search as string, as it works in IBO 4.8

//This should work (did in IBO4.8
IB_Query.OrderingItems.Text := 'field4=field1, field2, field3;field1 desc, field2 desc, field3';

//This works in IBO5.9, but does not get the result I need
//IB_Query.OrderingItems.Text := 'field4=field4;field4 desc';

IB_Query.OrderingLinks.Text := 'field4=1';
IB_Query.OrderingItemNo := 1;

And open the IB_Query.
The data is displayed in the correct order, but no incremental search is possible.
When I set 

IB_Query.OrderingItems.Text := 'field4=field4;field4 desc';

incremental search is possible, but ordering is wrong, as it does not order by the integer values.