Query Params Question

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Query Params Question

Post by snorkel » Wed 24 Dec 2008 16:31

Hi,
is there a way to turn off param checking for a query? Reason is many times PostgreSQL queries will have stuff like this in them:
select junk::text
The PGSQL way of casting uses : which is the same as what Delphi Params use. It would be nice to have a property called ParamCheck and if set to false it does no checking for params.

snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Post by snorkel » Wed 24 Dec 2008 17:11

Sorry, I see now there is a ParamCheck property, it's just not published.
Maybe considered publishing it, so it can be set at design time?

Thanks,

Snorkel

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 25 Dec 2008 11:04

When ParamCheck = False, the Params collection is not filled automatically. You should add parameters to Params manually.
But SQL statement is parsed anyway, and parameter names in the statement are replaced with $1, $2, etc.

Note 1: PgDAC does not treat ::name as a parameter. So don't worry about such type casts.

Note 2: The ParamCheck property works incorrecly in the beta version. We'll fix a bug with this this property in the next PgDAC build.
In the next build the ParamCheck property of TPgQuery will be published.

Post Reply