Accessing SQLINSERT etc.

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tsagoth
Posts: 33
Joined: Wed 15 Jul 2009 01:25

Accessing SQLINSERT etc.

Post by Tsagoth » Thu 21 Nov 2019 23:32

When you add SQL statements to the SQLINSERT, SQLUPDATE etc. properties, if you used parameters, then how do you access them to set the values, as in how do you specify a ParamByName for those options and not the .SQL property ? Or prepare them, because the Prepare method works against the .SQL stringlist, not the others.

frickler
Posts: 37
Joined: Wed 04 Apr 2018 08:30

Re: Accessing SQLINSERT etc.

Post by frickler » Mon 25 Nov 2019 11:44

AFAIK the other SQLxxx properties use the parameters you provide to the "main" SQL property.

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

Re: Accessing SQLINSERT etc.

Post by ViktorV » Tue 26 Nov 2019 12:02

A user can't directly access parameters of the SQLInsert, SQLUpdate, SQLDelete, and SQLRefresh queries. Either the current value of the corresponding field or the value of the field before query execution (if the name of the parameter starts with OLD_) will be used as the value for the parameter: https://devart.com/ibdac/docs/devart.da ... insert.htm
If the SQLInsert, SQLUpdate, SQLDelete, SQLRefresh properties are not empty, for example generated in design-time or set manually, IBDAC will use SQL query specified in this property. If the property is set to an empty string, IBDAC will automatically generate necessary SQL queries when executing the corresponding operations.
In most cases you do not have to specify SQLInsert, SQLUpdate, SQLDelete, SQLRefresh properties.
You should set these properties manually only in specific situations, when an automatically generated SQL query returns an incorrect result (for example, using complex queries)

Post Reply