Can I find the value of a bind variable in Oracle?
Date: 1997/10/24
Message-ID: <877675394.16224_at_dejanews.com>#1/1
Hi!
Is there anyway to find out what value a bind variable in Oracle has?
I noticed that there are two dynamic performance tables named
v_$sql_bind_data and
v_$sql_bind_metadata, but they don't seem to contain some useful
information.
Another thing is that these two tables aren't documented in Oracle7 Server
Reference manual
(the PDF version for 7.3)
Why I want to know these things is that I have a little SQL-script that lists a specific users active SQL-statements. This works allright, but the problem is that I only see the names of the bind variables in the output I get.
This is the script:
set termout off
/*
To be able to run these things, you first have to do the following:
connect sys/&syspass_at_&database
grant all on v_$session to &user;
grant all on v_$sqltext to &user;
(or just log in as sys or system)
*/
set termout on
set lines 150
set verify off
column username format a10
column program format a40
column osuser format a8
column sid format 9999
column serial# format 9999
accept name prompt 'Enter username [%]: ' default %
select t.sql_text SQL,s.username,s.osuser OSUSER, sid,serial#,program
from v$session s, v$sqltext t
where s.sql_address = t.address
and s.sql_hash_value = t.hash_value
and type = 'USER'
and status = 'ACTIVE'
and UPPER(username) like UPPER('&name')
and audsid <> userenv('sessionid')
order by t.address,t.hash_value,piece
/
set verify on
Can anyone please give me any advice?
(I'm fairly well accuainted ( <-- how do you *spell* this word?) with how
Oracle7 works)
/Mathias Dahl
E-mail: xmda_at_idok.se
-------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to UsenetReceived on Fri Oct 24 1997 - 00:00:00 CEST