<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to know when an Oracle table was last updated in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-know-when-an-Oracle-table-was-last-updated/m-p/918127#M44373</link>
    <description>&lt;P&gt;Googling the question provides this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SELECT SCN_TO_TIMESTAMP(MAX(ora_rowscn)) from myTable;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Apparently this only works for 'recent' updates so taking the max value is important.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2024 21:05:36 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2024-02-27T21:05:36Z</dc:date>
    <item>
      <title>how to know when an Oracle table was last updated</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-know-when-an-Oracle-table-was-last-updated/m-p/918124#M44371</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would like to know if someone has already developped a SAS scprit to estimate the last time an oracle table was updated.&lt;/P&gt;
&lt;P&gt;Please provide an example.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;PRE&gt;I have tried that in Toad:

SELECT (MAX(ora_rowscn)) from MRKT_???.QUALTRIX_??????;
The response is:

6479526695024 

select scn_to_timestamp(6479526695024) as timestamp from dual;

ora-08181; specific number is not a valid system change number
ora-06512 : at sys.scn_to_timestamp, line 1

&lt;/PRE&gt;
&lt;P&gt;How can I get the last updated date&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 20:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-know-when-an-Oracle-table-was-last-updated/m-p/918124#M44371</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-02-27T20:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to know when an Oracle table was last updated</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-know-when-an-Oracle-table-was-last-updated/m-p/918127#M44373</link>
      <description>&lt;P&gt;Googling the question provides this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;SELECT SCN_TO_TIMESTAMP(MAX(ora_rowscn)) from myTable;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Apparently this only works for 'recent' updates so taking the max value is important.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 21:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-know-when-an-Oracle-table-was-last-updated/m-p/918127#M44373</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-02-27T21:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to know when an Oracle table was last updated</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-know-when-an-Oracle-table-was-last-updated/m-p/918128#M44374</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically, such questions should be directed to your Oracle DBA. But here is what I was able to find on this page &lt;A title="Using Oracle Flashback Technology" href="https://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm#g1026131" target="_blank" rel="noopener"&gt;Using&amp;nbsp;&lt;SPAN&gt;Oracle Flashback Technology&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Using ORA_ROWSCN
ORA_ROWSCN is a pseudocolumn of any table that is not fixed or external. It represents the SCN of the most recent change to a given row; that is, the latest COMMIT operation for the row. For example:

SELECT ora_rowscn, last_name, salary
  FROM employees
  WHERE employee_id = 7788;

ORA_ROWSCN    NAME    SALARY
----------    ----    ------
    202553    Fudd      3000
The latest COMMIT operation for the row took place at approximately SCN 202553. &lt;STRONG&gt;To convert an SCN to the corresponding TIMESTAMP value, use the function SCN_TO_TIMESTAMP.&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 21:08:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-know-when-an-Oracle-table-was-last-updated/m-p/918128#M44374</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2024-02-27T21:08:21Z</dc:date>
    </item>
  </channel>
</rss>

