ODBC read error in Unidac 8.4.2 and 8.4.3
Posted: Mon 19 Apr 2021 14:49
After upgrading to Unidac 8.4.3, the ODBC provider cannot find all data on an Informix server. The same problem occurs with Unidac 8.4.2.
In Unidac 8.4.1 the data is read correctly.
For example, the code below:
/////////////////////////////////////
var
wNome_Lista_1, wNome_Lista_2: String;
cEmpresa: String;
begin
cEmpresa:='01';
With uniQuery do Begin
SQL.Clear;
SQL.Add('select num_list_preco, den_list_preco, dat_ini_vig, dat_fim_vig');
SQL.Add('from desc_preco_mest where cod_empresa=:empresa and num_list_preco=:lista');
ParamByName('empresa').AsString:=cEmpresa;
ParamByName('lista').AsInteger:=StrToIntDef(Lista_1.Text, 26);
Open;
wNome_Lista_1:=FieldByName('den_list_preco').AsString+'. Vigência '+
FormatDateTime('DD/MM/YYYY', FieldByName('dat_ini_vig').AsDateTime)+' a '+
FormatDateTime('DD/MM/YYYY', FieldByName('dat_fim_vig').AsDateTime)+'.';
Close;
ParamByName('lista').AsInteger:=StrToIntDef(Lista_2.Text, 26);
Open;
wNome_Lista_2:=FieldByName('den_list_preco').AsString+'. Vigência '+
FormatDateTime('DD/MM/YYYY', FieldByName('dat_ini_vig').AsDateTime)+' a '+
FormatDateTime('DD/MM/YYYY', FieldByName('dat_fim_vig').AsDateTime)+'.';
Close;
End;
Showmessage(wNome_Lista_1+#13#10+);
wNome_Lista_2);
end;
/////////////////////////////////
Unidac version 8.4.1 returns:
----------------------------------------
Lista Capital. Vigência 01/04/2021 a 31/12/2021
Lista Interior. Vigência 08/04/2021 a 31/12/2021
----------------------------------------
But in versions 8.4.2 and 8.4.3 the second open returns as empty:
----------------------------------------
Lista Capital. Vigência 01/04/2021 a 31/12/2021
. Vigência 30/12/1899 a 30/12/2021
----------------------------------------
I detected that this problem occurs with the Informix ODBC driver (with PostgreSQL ODBC the query is done correctly).
The customer is using Informix ODBC version 09.56.0000 FC12WE.
I had to downgrade to version 8.4.1, as in versions 8.4.3 and 8.4.2, UniQuery correctly executes only the first query. Subsequent queries in the same TUniQuery do not return data (isEmpty = True).
So far this has only happened with the ODBC driver for the Informix database.
In Unidac 8.4.1 the data is read correctly.
For example, the code below:
/////////////////////////////////////
var
wNome_Lista_1, wNome_Lista_2: String;
cEmpresa: String;
begin
cEmpresa:='01';
With uniQuery do Begin
SQL.Clear;
SQL.Add('select num_list_preco, den_list_preco, dat_ini_vig, dat_fim_vig');
SQL.Add('from desc_preco_mest where cod_empresa=:empresa and num_list_preco=:lista');
ParamByName('empresa').AsString:=cEmpresa;
ParamByName('lista').AsInteger:=StrToIntDef(Lista_1.Text, 26);
Open;
wNome_Lista_1:=FieldByName('den_list_preco').AsString+'. Vigência '+
FormatDateTime('DD/MM/YYYY', FieldByName('dat_ini_vig').AsDateTime)+' a '+
FormatDateTime('DD/MM/YYYY', FieldByName('dat_fim_vig').AsDateTime)+'.';
Close;
ParamByName('lista').AsInteger:=StrToIntDef(Lista_2.Text, 26);
Open;
wNome_Lista_2:=FieldByName('den_list_preco').AsString+'. Vigência '+
FormatDateTime('DD/MM/YYYY', FieldByName('dat_ini_vig').AsDateTime)+' a '+
FormatDateTime('DD/MM/YYYY', FieldByName('dat_fim_vig').AsDateTime)+'.';
Close;
End;
Showmessage(wNome_Lista_1+#13#10+);
wNome_Lista_2);
end;
/////////////////////////////////
Unidac version 8.4.1 returns:
----------------------------------------
Lista Capital. Vigência 01/04/2021 a 31/12/2021
Lista Interior. Vigência 08/04/2021 a 31/12/2021
----------------------------------------
But in versions 8.4.2 and 8.4.3 the second open returns as empty:
----------------------------------------
Lista Capital. Vigência 01/04/2021 a 31/12/2021
. Vigência 30/12/1899 a 30/12/2021
----------------------------------------
I detected that this problem occurs with the Informix ODBC driver (with PostgreSQL ODBC the query is done correctly).
The customer is using Informix ODBC version 09.56.0000 FC12WE.
I had to downgrade to version 8.4.1, as in versions 8.4.3 and 8.4.2, UniQuery correctly executes only the first query. Subsequent queries in the same TUniQuery do not return data (isEmpty = True).
So far this has only happened with the ODBC driver for the Informix database.