Record creation date

Posted by bremmeyr on 01-Sep-2015 13:59

OpenEdge 11.5. From ABL or SQL connection is there a stored underlying value of when a record is created? My question is taking into consideration that the application does not have a date column in the table to store the creation date. Is there a built in value that can be accessed? 

All Replies

Posted by Richard Banville on 01-Sep-2015 14:08

No, there is no internal or automatic record date/time stamp or entry order available.

Posted by Peter Judge on 01-Sep-2015 14:11

You could enable auditing for that, I think (ie log the creation dates). But that would only work going forward in time (ie not much help for what's currently created).
 
[collapse]
From: Richard Banville [mailto:bounce-richb@community.progress.com]
Sent: Tuesday, 01 September, 2015 15:10
To: TU.OE.RDBMS@community.progress.com
Subject: RE: [Technical Users - OE RDBMS] Record creation date
 
Reply by Richard Banville

No, there is no internal or automatic record date/time stamp or entry order available.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by bremmeyr on 01-Sep-2015 14:12

Thank you both.

Posted by gus on 01-Sep-2015 14:23

> On Sep 1, 2015, at 3:12 PM, Peter Judge wrote:
>
> You could enable auditing for that, I think (ie log the creation dates). But that would only work going forward in time (ie not much help for what's currently
> created).

Way overkill.

Add a column of type datetime to hold the creation timestamp. Set the value in a trigger. But do not do this for /every/ table, just a few that matter.

Do you really need to know the creation time anyway?

Posted by Richard Banville on 01-Sep-2015 14:28

Yes, of course, add a field and triggers, but that does not answer the question being asked ;)

Posted by cverbiest on 02-Sep-2015 01:57

way overkill ;-)

add a datetime field with initial now.

No answer to the OP but it might help people who are designing their db schema to take this into account.

Posted by gus on 02-Sep-2015 08:24

should have remembered this yesterday:

you can have a column of type date with an initial value of today or of
type datetime with an initial value of now.

in either case, the initial value will be filled in with the current date
or datetime when you create a record.

simple, no code, no triggers, no auditing necessary.

This thread is closed