About unidac 3.003 of " DMLRefresh "

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wjzws
Posts: 20
Joined: Fri 17 Jul 2009 02:33

About unidac 3.003 of " DMLRefresh "

Post by wjzws » Mon 02 Nov 2009 12:34

Hello:


For the property "DMLRefresh" usage, I am not too clear, in the end what that means.

"Use the DMLRefresh property to refresh record by RETURNING clause when insert or update is performed.
The default value is False."


Be able to help me explain it in detail?



The best example of what the code can be used.



Thank you.

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

Post by Plash » Tue 03 Nov 2009 08:41

DMLRefresh can be used instead of RefreshOptions.roAfterInsert and roAfterUpdate. When DMLRefresh = True, TUniQuery generates an SQL statement like the following to insert record:

INSERT INTO Table1(A, B) VALUES(:A, :B)
RETURNING A, B

This statement inserts a record and returns back fields values. This is useful if the fields values are modified by a trigger, for autoincrement fields, and for fields with default values.

Not all DBMS support the RETURNIG clause. RETURNING is supported by Oracle, PostgreSQL (starting with 8.2 version), and Firebird (starting with 2.0 version).

There is no need in code example. You just set the DMLRefresh property in Object Inspector.

tobias_cd
Posts: 56
Joined: Thu 18 Dec 2008 22:10

Post by tobias_cd » Tue 03 Nov 2009 09:11

Plash wrote:There is no need in code example. You just set the DMLRefresh property in Object Inspector.
Plash,

the DMLRefresh property is not published for TUniTable. Can DMLRefresh still be used (setting it by code then) with TUniTable as you described?

Regards,
Tobias

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

Post by Plash » Tue 03 Nov 2009 09:38

We will publish this property for TUniTable in the next UniDAC build.

wjzws
Posts: 20
Joined: Fri 17 Jul 2009 02:33

Post by wjzws » Wed 04 Nov 2009 05:39

thanks !

Post Reply