Posted By

theonlyalterego on 04/14/09


Tagged

database sql version Oracle history application Framework OAF


Versions (?)

Oracle SQL - Select OAF File version history


 / Published in: SQL
 

This sql query will select the past version information about a given file from the database. An example would be searching for %ApprovalHistoryVOImpl% would return all past version numbers (in the database) for the ApprovalHistoryVOImpl.class file.

This is useful for checking which patch versions of a file have been applied to a given database.

  1. SELECT
  2. f.file_id,
  3. f.filename,
  4. f.app_short_name,
  5. b.orig_bug_number patch_num,
  6. v.version,
  7. a.creation_date,
  8. decode(a.common_action_id, 4043, 'copy', 72746, 'sql') action
  9. FROM
  10. ad_files f,
  11. ad_file_versions v,
  12. ad_patch_run_bug_actions a,
  13. ad_patch_run_bugs b
  14. WHERE
  15. f.filename = '&file_name'
  16. AND f.file_id = v.file_id
  17. AND v.file_version_id = nvl(a.patch_file_version_id, a.onsite_file_version_id)
  18. AND a.patch_run_bug_id = b.patch_run_bug_id
  19. ORDER BY a.action_id

Report this snippet  

You need to login to post a comment.