Table creation script
Code: Select all
CREATE TABLE TEST
(
"NAME" VARCHAR(10)
);
SQL Query
Code: Select all
q.SQL.Text := 'SELECT * FROM Test WHERE Name = :value';
IBDAC 7.2.4
This code
Code: Select all
q.Options.DescribeParams := false;
q.Params.Items[0].AsString := '12345678901';
q.Open;
produces this error message
Code: Select all
Dynamic SQL Error
SQL error code = -303
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 10, actual 10
This code
Code: Select all
q.Options.DescribeParams := true;
q.Params.Items[0].AsString := '12345678901';
q.Open;
produces no error.
IBDAC 7.4.3
This code
Code: Select all
q.Options.DescribeParams := false;
q.Params.Items[0].AsString := '12345678901';
q.Open;
produces this error message
Code: Select all
Dynamic SQL Error
SQL error code = -303
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 10, actual 10
This code
Code: Select all
q.Options.DescribeParams := true;
q.Params.Items[0].AsString := '12345678901';
q.Open;
produces this error message (note the difference, actual 11)
Code: Select all
Dynamic SQL Error
SQL error code = -303
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 10, actual 11