Page 1 of 1

About unidac 3.003 of " DMLRefresh "

Posted: Mon 02 Nov 2009 12:34
by wjzws
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.

Posted: Tue 03 Nov 2009 08:41
by Plash
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.

Posted: Tue 03 Nov 2009 09:11
by tobias_cd
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

Posted: Tue 03 Nov 2009 09:38
by Plash
We will publish this property for TUniTable in the next UniDAC build.

Posted: Wed 04 Nov 2009 05:39
by wjzws
thanks !