0

I want to know the last update time of a Cache Intersystems DB table. Please let me know the relevant command. I ran through their command documentation:

http://docs.intersystems.com/latest/csp/docboo/DocBook.UI.Page.cls?KEY=GTSQ_commands

But I don't see any such command there. I also tried searching through this :

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_currenttimestamp

Is this not the complete documentation of commands ?

dig_123
  • 2,240
  • 6
  • 35
  • 59

1 Answers1

1

Cache' does not maintain "last updated" information by default as it might introduce unnecessary performance penalty on DML operations.

You can add this field manually to every table of interest:

Property LastUpdated As %TimeStamp [ SqlComputeCode = { Set {LastUpdated}= $ZDT($H, 3) }, SqlComputed, SqlComputeOnChange = (%%INSERT, %%UPDATE) ];

This way it would keep the time of last Update/Insert for every row, but still it would not help you with Delete.

Alternatively - you can setup triggers for every DML operation that would maintain timestamp in a separate table.

Without additional coding the only way to gather this information is to scan Journal files, which is not really intended use for these and would be slow at best.

Anton
  • 3,587
  • 2
  • 12
  • 27