Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL query is ignoring bind variable value before execution

SGBUS1May 9 2025 — edited May 9 2025

Hi
the following query (with bind variables set to values) instantly returns zero rows

SELECT ..
FROM ..
WHERE date-column BETWEEN :var1 AND :var2
AND 0 = 1

but the following query where bind variable :var3 is set to 0 still executes (with significant time elapsing on large data sets) before returning zero rows

SELECT ..
FROM ..
WHERE date-column BETWEEN :var1 AND :var2
AND :var3 = 1

Can anyone explain why ?
Obviously my fundamental understanding of bind variables is lacking.

Thanks

Comments
Post Details
Added on May 9 2025
1 comment
145 views