HELP : Informix and Delphi
Posted in 1997
Topics: General Discussion
I have many problems with dynamic queries from Delphi 2.01, using SQL-LINKS 3.5 and Informix IConnect 7.2. My server is a Informix SE v5 database. Actually, I have problems with string parameters : - If I open a dynamic query with a restriction on an indexed integer column, no problems : (Table SER has 100000 lines) Query.SQL.Add('select * from ser '); Query.SQL.ADD(' where num_ser = :num'); Query.Params[0].AsInteger := 123; Query.Prepare; Query.Open; -> Answer is immediate - If I open e dynamic query with a restriction on an indexed string column (declared as CHAR(20)) on Informix database : (Table MAL has 45000 lines) Query.SQL.Add('select * from mal'); Query.SQL.Add(' where nom_mal = :nom'); Query.Params[0].AsString := 'DUPONT'; Query.Prepare; Query.Open; -> Answer after a long minute - The same query with the KeyWord "matches" answers immediately !!! Query.SQL.Add('select * from mal'); Query.SQL.Add(' where nom_mal matches :nom'); Query.Params[0].AsString := 'DUPONT'; Query.Prepare; Query.Open; -> Answer immediate !!!! - If I open a query on table MAL with a restriction on a unique indexed string column (declared as CHAR(6)), I have problems : Rmq : column Mal.num_dos is a string column but contains only number characters which are considered as a string Query.SQL.Add('select * from mal'); Query.SQL.Add(' where num_dos = :nodos'); Query.Params[0].AsString := '123425'; Query.Prepare; Query.Open; -> Answer after a long minute - I have tried the same keyword "matches" as it worked well with column Mal.nom_mal Query.SQL.Add('select * from mal'); Query.SQL.Add(' where num_dos matches :nodos'); Query.Params[0].AsString := '123425'; Query.Prepare; Query.Open; -> Answer after 8 seconds! I really can't understand what's the matter !! Does anyone know the same problems? Thank You Beatrice