on 09-08-2014 11:32 PM
Hi,
We have tables that are replicated from SAP using SLT.
We are trying to add a column to that table, so we can capture insert/update datetime every time a record is inserted or updated in the table.
We have two options currently:
1. We can add the physically add the column to the table and use the transformation from SLT server to update/insert the date with current_timestamp.
2. Adding trigger to the tables - We were told by SAP that this was not a good practice for replicated tables.
Instead of configuring in SLT server, we are trying to see if we can do this using virtual column like "Alter Table xxx Generate Always As
current_timestamp).
Apparently we cannot use Current_Timestamp in Generated As columns.
My question is does anyone know any work around where we can assign current_timestamp to virtual columns?
Or is there any way I can accomplish this other than using virtual columns?
I cannot use default in a column as it needs to update for both insert and update.
Thank you for your help.
Hyun
Hi Hyun,
We are having the same scenario to get current_timestamp as virtual column in a table in HANA. Were you able to get through with any workarounds?
Please share your comments.
Thanks,
Remya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guys,
what is the use case here?
Why is it even relevant to know the server time when a record had been inserted by SLT?
Be very clear about that this is not an application level timestamp.
It doesn't tell you when the record was changed in the application nor when it was valid for the application.
So, what is behind the mysterious scenario to have a column that is automagically filled with the DB server timestamp of when a record is gets inserted/updated in a table?
- Lars
Hi Lars,
Sharing you the details on my requirement.
We are trying to mark the current date, current week, current fiscal week in the time dimension table. The first 2 scenarios can be handled using the expression in HANA, but not fiscal week.
If I can get today's date as a virtual column in Time Dimension, I will use this to join to another instance of Time Dimension to get the current fiscal week.
Please share your thoughts.
Thanks,
Remya
I have a similar scenario as In my requirement is....
Through a procedure , we are extracting data from view to a reporting table through a field called LAST_CHANGED ( updates the last changed timestamp in the base tables )
Now when are tables are getting replicated through SLT , we expect a latency delay
ie: if a table is getting changed at 3:00 pm at the source , my view (target) gets the data at 3.30 pm. So in order to deal with this we are planning to have a current timestamp filed in the View so that my procedure get extract the delta records based upon the current time stamp field.
need suggestions on how to handle this situation apart from using DB triggers.
Thanks for your help.
Regards
Aravind.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.