Here the following is an example SQL statement with an “Or Bind Variable is Null” expression syntax.
SELECT * FROM EMPLOYEE
WHERE (EMP_ID<:INPUT_LIMIT OR :INPUT_LIMIT IS NULL)
It is quite a common usage of using bind variables as a user’s input range to select a specific number of records from a table, a NULL or a specific input value may be used to indicate no limit is set and everything will be retrieved.
Here the following are the query plans of this SQL, it takes 4.82 seconds to...
How to Tune SQL Statement with “Or Bind Variable is Null” Expression for Oracle?
SELECT * FROM EMPLOYEE
WHERE (EMP_ID<:INPUT_LIMIT OR :INPUT_LIMIT IS NULL)
It is quite a common usage of using bind variables as a user’s input range to select a specific number of records from a table, a NULL or a specific input value may be used to indicate no limit is set and everything will be retrieved.
Here the following are the query plans of this SQL, it takes 4.82 seconds to...
How to Tune SQL Statement with “Or Bind Variable is Null” Expression for Oracle?