How to find bind variable values for a given sql_id in Oracle: Easy Guide

find bind variable values for a given sql_id

Today in this article, we will see how to find bind variable values for a given sql_id in Oracle. Let’s go through this.

Query to find bind variable values for a given sql_id :

Issue below Queris to find bind variable values : Provide or change your sql_id accordingly in the below queries :

Query 1:

  SELECT NAME,POSITION,DATATYPE_STRING,VALUE_STRING
 FROM v$sql_bind_capture WHERE sql_id='64dos75g84wp8s';

Query 2 :

SELECT sql_id, NAME,DATATYPE_STRING,VALUE_STRING
FROM DBA_HIST_SQLBIND WHERE SQL_ID='69ds85g84wp8s' ;

Query 3 :

SELECT
sql_id,
x.sql_text sql_text,
y.name bind_name,
y.value_string bind_value
FROM
v$sql x
JOIN
v$sql_bind_capture y using (sql_id)
WHERE
y.value_string is not null
AND
sql_id='&sqlid';

Also, you can get more information from the Oracle Doc too.

Oracle Related Articles :

Leave a Reply