Can't Prepare when '$' is included in parameter name

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tsteinmaurer
Posts: 52
Joined: Thu 17 Dec 2009 08:25

Can't Prepare when '$' is included in parameter name

Post by tsteinmaurer » Sun 09 Feb 2014 20:05

Hello,

I've upgraded to 5.2.5. The following used to work in previous versions, but fails in 5.2.5.

I have the following table:

Code: Select all

CREATE TABLE T10 
(
  T10$ID               INTEGER         NOT NULL,
  T10$ID2              INTEGER,
 CONSTRAINT PK_T10 PRIMARY KEY (T10$ID)
);
A TIBCSQL instance with the following statement:

Code: Select all

insert into t10 (t10$id, t10$id2) values (:t10_id, :t10_id2)
Preparing the statement with the following code in Delphi 2010:

Code: Select all

if not IBCSQL1.Prepared then
  IBCSQL1.Prepare;
fails with the following exception text:

Code: Select all

First chance exception at $7500C41F. Exception class EIBCError with message
'
Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 44
$'.
Process IBDacPrepareBug.exe (4000)
Obviously, if I remove the '$' from parameter names, preparing the statement works.

Any ideas?

Thanks.

tsteinmaurer
Posts: 52
Joined: Thu 17 Dec 2009 08:25

Re: Can't Prepare when '$' is included in parameter name

Post by tsteinmaurer » Wed 12 Feb 2014 21:49

Any ideas? Thanks.

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: Can't Prepare when '$' is included in parameter name

Post by PavloP » Fri 14 Feb 2014 10:48

To use parameters with name containing a '$' symbol, quote them, for example:

Code: Select all

insert into t10 (t10$id, t10$id2) values (:"t10$id", :"t10$id2")
When using the TIBCTable and TIBCQuery components, set the Options.QuoteNames property to True.

tsteinmaurer
Posts: 52
Joined: Thu 17 Dec 2009 08:25

Re: Can't Prepare when '$' is included in parameter name

Post by tsteinmaurer » Fri 14 Feb 2014 15:44

Ok. Thanks. But having to use that options in this particular case regarding parameter names is new? Why not keep it backwards-compatible?

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: Can't Prepare when '$' is included in parameter name

Post by PavloP » Tue 18 Feb 2014 11:49

We have reproduced the problem and fixed it. This fix will be included in the next IBDAC build.

Post Reply