IBCConnection.ExecSQL with stringparam - string right truncation

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Jank
Posts: 35
Joined: Tue 11 May 2010 11:57

IBCConnection.ExecSQL with stringparam - string right truncation

Post by Jank » Thu 08 Oct 2015 08:10

Hello,

I am playing with IBDAC 5.6.19 for RAD Studio 10.
If I do IBCConnection1.ExecSQL with stringparams like that:

Code: Select all

  IBCConnection1.Open;
  IBCConnection1.ExecSQL('select * from rdb$database where rdb$database.rdb$security_class = :rdb$text', ['asdf']);
  IBCConnection1.Close;
I recive the exception:
Dynamic SQL Error
SQL error code = -303
arithmetic exception, numeric overflow, or string truncation
string right truncation
If I do this with a IBCQuery-Object it works:

Code: Select all

  IBCConnection1.Open;
  IBCQuery1.sql.Text := 'select * from rdb$database where rdb$database.rdb$security_class = :text';
  IBCQuery1.ParamByName('text').AsString := 'ASD';
  IBCQuery1.ExecSQL;
  IBCQuery1.Close;
  IBCConnection1.Close;
I tried it with a Dialect 3/UTF8-DB and with a Dialect 1/WIN1252-DB.

What do I wrong?

Regards, Jan

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: IBCConnection.ExecSQL with stringparam - string right truncation

Post by ViktorV » Thu 08 Oct 2015 10:50

Thank you for the information. We have reproduced the issue. We are investigating this behavior of IBDAC, and we will inform you about the results.

Post Reply