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!

How to ensure a hard parse happens!

orausernJan 17 2013 — edited Jan 17 2013
Hi,
We are on Oracle 11.2.0.2 on Solaris 10. I have a situaion where a query coming from java code and which uses prepared statement is not doing well. Now if I put this hint /*+ CURSOR_SHARING_EXACT */ and run the sql with literal it goes very fast.

something like select ename from emp where empno=112; is very fast but select ename from emp where empno=:1 is very slow. Now we have to ensure the query does not use bind variable. How do I ensure it? What do I need to tell the developer so that he writes the sql in such a way that it doesn't use bind variables (please take other facts are proven - I mean that once the query doesn't use bind variable it goes very fast is repeatedly tested and confirmed, the question is now how to ensure it).

thanks,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 14 2013
Added on Jan 17 2013
7 comments
712 views