{"id":45,"date":"2014-04-16T09:50:00","date_gmt":"2014-04-16T14:50:00","guid":{"rendered":"https:\/\/www.chrystalsander.com\/blog\/?p=45"},"modified":"2023-07-26T12:36:25","modified_gmt":"2023-07-26T17:36:25","slug":"sql-get-last-update-timestampe-for-a-table","status":"publish","type":"post","link":"https:\/\/www.chrystalsander.com\/blog\/?p=45","title":{"rendered":"SQL : Get Last Update TimeStampe For A Table"},"content":{"rendered":"<p><\/p>\n<div>\nI have some Oracle tables that have no datestamp on them<br \/>\nthat would display the last update of that row.&nbsp;<br \/>\nHere is a query for that:<o:p><\/o:p><\/div>\n<div>\n<\/div>\n<div style=\"margin-bottom: 0.0001pt;\">\n<span style=\"background: white; color: blue; font-family: Courier; font-size: 10.0pt; mso-bidi-font-family: Courier; mso-highlight: white;\">SELECT<\/span><span style=\"background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Courier; font-size: 10pt;\"> <\/span><span style=\"background: white; color: blue; font-family: Courier; font-size: 10.0pt; mso-bidi-font-family: Courier; mso-highlight: white;\">SCN_TO_TIMESTAMP(<\/span><span style=\"background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Courier; font-size: 10pt;\"> <\/span><span style=\"background: white; color: blue; font-family: Courier; font-size: 10.0pt; mso-bidi-font-family: Courier; mso-highlight: white;\">ORA_ROWSCN<\/span><span style=\"background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Courier; font-size: 10pt;\"> <\/span><span style=\"background: white; color: blue; font-family: Courier; font-size: 10.0pt; mso-bidi-font-family: Courier; mso-highlight: white;\">)<\/span><span style=\"background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Courier; font-size: 10pt;\"><o:p><\/o:p><\/span><\/div>\n<div>\n<span style=\"background: white; color: blue; font-family: Courier; font-size: 10.0pt; line-height: 115%; mso-bidi-font-family: Courier; mso-highlight: white;\">FROM<\/span><span style=\"background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Courier; font-size: 10pt; line-height: 115%;\"> YOURTABLE<\/span><span style=\"font-family: Courier; font-size: 10pt; line-height: 115%;\">;<o:p><\/o:p><\/span><\/div>\n<div>\n<\/div>\n<div>\nSample output would look something like:<o:p><\/o:p><\/div>\n<div>\n<\/div>\n<div>\n4\/16\/2014 9:01:26.000000000 AM<o:p><\/o:p><\/div>\n<div>\n<\/div>\n<div>\nOf course, you can add a where clause to determine update<br \/>\nfor your particulars.<o:p><\/o:p><\/div>\n<div>\n<\/div>\n<div>\nFor more information:&nbsp;<a href=\"http:\/\/docs.oracle.com\/cd\/B19306_01\/server.102\/b14200\/functions142.htm\" target=\"_blank\" rel=\"noopener\">SCN_TO_TIMESTAMP<\/a><o:p><\/o:p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I have some Oracle tables that have no datestamp on them that would display the last update of that row.&nbsp; Here is a query for that: SELECT SCN_TO_TIMESTAMP( ORA_ROWSCN ) FROM YOURTABLE; Sample output would look something like: 4\/16\/2014 9:01:26.000000000 AM Of course, you can add a where clause to determine update for your particulars. &hellip; <a href=\"https:\/\/www.chrystalsander.com\/blog\/?p=45\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SQL : Get Last Update TimeStampe For A Table&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45,27],"tags":[43],"_links":{"self":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/45"}],"collection":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=45"}],"version-history":[{"count":1,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":171,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/45\/revisions\/171"}],"wp:attachment":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}