SQLText - Displays text of SQL for a specific hash_value
--
--  Name: sqltext_hash_value.sql
--  
--  Parms:
--     #1: hash_value 
--
--  Description: SQLText - Displays text of SQL for a specific hash_value
--               The hash_value can be found in different other views such as:
--                  . hash_value of v$sqlarea
--                   
--  Compatability: 7.3.x and above
--
--  Usage: @sqltext_hash_value hash_value
--         @sqltext_hash_value 3169574167
--
-- save SQL*Plus settings:
--store set savesqlplus_settings.sql replace
-- set SQL*Plus settings:
set linesize 133
set pages 40
--
column sql_address noprint 
column username format a12 
column osuser format a20
break on osuser on username on sid skip 1 
select sql_text
from v$sqltext a
where hash_value = '&&1'
order by ADDRESS, piece;


--
-- restore SQL*Plus settings:
--@savesqlplus_settings