Oracle Functions as field values

Thevinin

Member
I need to be able to specify Oracle functions for particular fields in a record. These functions need to end up in the substituted SQL generated by DOA objects.
As an example I have records that have timestamps created/updated whenever the record is created/changed. We need to utilize the server time, not the client date/time. If I was writing the SQL it would be something like:
update
set TIMESTAMP=sysdate
(sysdate being the Oracle function)
I am not sure how to accomplish this, or even if it is feasible with DOA. I have tried using default expressions and setting the appropriate settings in the OracleDictionary properties (DefaultValues and DynamicDefaults are true). I would appreciate any help you can provide on this issue.
 
TField.DefaultExpression will be evaluated on the Server, so this should be okay. What exactly goes wrong?

------------------
Marco Kalter
Allround Automations
 
DefaultExpression doesn't seem to work. I am using Oracle Monitor to examine the SQL generated and sent to server. I do not see any SQL UPDATE statement that includes the DefaultExpression. Is there something I haven't set correctly? I have tried using one of the two DefaultExpressions:
1. sysdate
2. select sysdate from dual

Neither seems to have any affect.
 
A DefaultExpression only applies to newly inserted records, not to updated records.

------------------
Marco Kalter
Allround Automations
 
Back
Top