Showing posts with label bind variables. Show all posts
Showing posts with label bind variables. Show all posts

Tuesday, January 11, 2011

Bind Variable Capture

When capturing bind variable it is easy to get the character and number data but other types are obscured in the anydata type.

Here's a script to help to unmask those values.

col data_value for a50

accept SQLID prompt 'Enter SQL ID : '

select position
     , case datatype
            when 180 then to_char(anydata.accesstimestamp(value_anydata),'DD-MON-YYYY HH24:MI:SS')
            when  12 then to_char(anydata.accessdate(value_anydata),'DD-MON-YYYY HH24:MI:SS')
            else value_string
       end data_value
from  v$sql_bind_capture
where sql_id = '&SQLID';