Can SQL Developer SQL Tuning Advisor bind variables be null?

613 views Asked by At

In SQL Developer (v 4.1) when I try to run the SQL Tuning Advisor on a query with one or more bind variables, if I leave any of them null, the SQL Tuning Advisor doesn't show any info at all. Is this a SQL Developer bug, or have I misunderstood something about null values, binding, and tuning?

Here is a simple example:

select * from dual where :p = 1;

Highlight the query and press Ctrl + F12, and you're prompted for the value of p. Leave the "NULL" checkbox checked and click "Apply":

Enter Binds for p

The SQL Tuning Advisor seems to quit running immediately and displays no detail for the query:

SQL Tuning Advisor showing empty Details

Is this a SQL Developer bug, or have I misunderstood something about null values, binding, and tuning?

1

There are 1 answers

0
Ted at ORCL.Pro On
select * from dual where nvl(:p,-1) = 1;

any null in WHERE clause makes all boolean algebra NULL (FALSE)