Text and number as Param

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dupe
Posts: 20
Joined: Wed 15 Jun 2016 13:37

Text and number as Param

Post by dupe » Thu 01 Sep 2016 07:53

We have a problem with params in our SQL.
If we define an SQL statement with a param like:

SELECT * FROM Test WHERE Column = :1Param

SDAC only shows the "1" as param but not the whole "1Param".
We used ADO before and it hadn't this problem.
Do you have any ideas what we could do?

In TParser.InternalGetNext you distinguish between numbers and alphas.
There is a routine called "IsAlpha" and "IsNumber".
Is there a reason for this?

Best regards

dupe
Posts: 20
Joined: Wed 15 Jun 2016 13:37

Re: Text and number as Param

Post by dupe » Thu 01 Sep 2016 08:58

We have a problem with quoted params too.

SELECT * FROM TEST WHERE Column = :'A A'

In this case we dont even have a param.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Text and number as Param

Post by AlexP » Thu 01 Sep 2016 11:32

Hello,

To use such parameter names, you should quote them with square brackets

Code: Select all

SELECT * FROM Test WHERE Column = :[1Param]

dupe
Posts: 20
Joined: Wed 15 Jun 2016 13:37

Re: Text and number as Param

Post by dupe » Thu 01 Sep 2016 11:56

In our program the users have the opportunity to write their own statements.
And because it's in use for many years now there are over thousands of none quoted parameters.
So we can't force them to quote their's.
Why is there such a behavior?
Is there a possibility to get the old ADO behavior?

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

Re: Text and number as Param

Post by ViktorV » Tue 06 Sep 2016 09:36

We will consider the possibility to implement this functionality in one of the next SDAC versions.

Post Reply