All Forums Database
stahengik 15 posts Joined 10/14
05 Mar 2015
How to get the statement used to updated/populate a table

Is there a way I can check how the table has been updated.
I mean I can get the DDL by using "Show table database.Tablename" but what I want to know is what was the select statement that was used to updated the table.
Is there a way to get that ?

MaximeV 19 posts Joined 11/13
06 Mar 2015

Check on dbc.Dbqlogtbl the queries that occured on your table. ( column  querytext like '%Tablename%' )

teradatauser2 236 posts Joined 04/12
06 Mar 2015

Join pdcrinfo.Dbqlogtbl_hst and  pdcrinfo.Dbqsqltbl_hst on query id, proc id and logdate. And put a filter in querytext like '%tablename%'. This column is present in pdcrinfo.Dbqsqltbl_hst. Use this version if the query is run a day before you want to check. If you want to check for the same day, use the DBC version of the tables.

You must sign in to leave a comment.