Is it useful to use bind variables when there are no variables?
For example
SELECT count(1) as cantidad
FROM MYTABLA
WHERE CAMPO1=5
This query will always be executed the same, 5 will always be 5 and will not change.
As far as Oracle keeps the execution plan of this setentencia and for the next time an execution is requested to Oracle, Oracle instead of analyzing Query will look in its area of SGA and will proceed.
Does it have any advantage to use a Bind variable that will never change its value?
This I ask why an oracle expert said:
"Al usar constantes en cada ejecución, causa que se genere un sql id diferente debido al hard parse en la base de datos, haciendo imposible adjuntar un profile a la query."