Page 1 of 1

Incorrect parameter length in version 4.45.13

Posted: Mon 08 Dec 2008 13:09
by tomazl
After installing DBX driver version 4.45.13, some of my queries stoped to work. For example, when using TSimpleDataSet and setting it like this:

Code: Select all

with SP1 do
begin
    Close;
    DataSet.CommandType := ctQuery;
    DataSet.CommandText :=
      'SELECT   * ' +
      'FROM     MyTable ' +
      'WHERE    (Par1 = :parInt1)';
    DataSet.Params.ParamByName('parInt1').Value := 'IZP0026';
    Open;
end;
... the parameter length is incorrectly calculated (as VARCHAR(16), but actually 7). By checking with SQL Profiler, I got the following:

--v4.45.13
exec sp_executesql
N'SELECT *
FROM "MyTable"
WHERE (Par1 = @P1)',
N'@P1 varchar(16)', 'IZP0026 iň ôü| '

--v4.45.12
exec sp_executesql
N'SELECT *
FROM "MyTable"
WHERE (Par1 = @P1)',
N'@P1 varchar(7)', 'IZP0026'

Posted: Tue 09 Dec 2008 14:06
by Dimon
I could not reproduce the problem.
Please send me a complete small sample at dmitryg*devart*com to demonstrate it, including a script to create and fill table.

Also supply me the following information:
- the exact version of your IDE;
- the exact version of SQL server and client.