Created
April 26, 2020 04:01
-
-
Save VikramVasudevan/5ae0578a977e32ae8cb2ffaf69174d0b to your computer and use it in GitHub Desktop.
Oracle ROWSCN Demo - Part 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT 'Updating 1 record in table ...' STATUS_MSG FROM DUAL; | |
UPDATE t | |
SET y = 'DUAL123' | |
WHERE x = 1; | |
COMMIT; | |
SELECT 'Fetching changed data in table ...' STATUS_MSG FROM DUAL; | |
SELECT t.* | |
-- dbms_rowid.rowid_block_number (ROWID) blockno, | |
-- SCN_TO_TIMESTAMP (t.ORA_ROWSCN), | |
-- t.ORA_ROWSCN | |
FROM t | |
WHERE t.ORA_ROWSCN > :max_row_scn; | |
SELECT 'Resetting max scn ...' STATUS_MSG FROM DUAL; | |
BEGIN | |
SELECT MAX(ORA_ROWSCN) max_row INTO :max_row_scn FROM T; | |
END; | |
/ | |
print max_row_scn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment