Skip to Main Content

Integration

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!

Native SQL Performance Difference Between Hard-Coded Value and Parameter

user13131199May 11 2011 — edited May 16 2011
Hi,

I have a native SQL (Oracle) query (fairly long & complex with a few sub-queries) that returns in under a second in both ODSI and using an external SQL tool. This query has a hard-coded value for a particular column, namely, a date column.
When I modify the ODSI function signature so that I pass in a parameter and then replace the hard-coded value in the native SQL with the appropriate parameter binding notation (i.e. '?'), the query takes much longer (2-30 seconds). The duration of the query depends on how many records are actually returned, so it must be running a separate query for each of the results (i.e. the more results returned, the longer the query takes to return).
What can I do to keep the duration of my ODSI query low while allowing for the parameter?
This post has been answered by Mike Reiche-Oracle on May 13 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2011
Added on May 11 2011
27 comments
8,762 views