SQL Performance (MOSC)

MOSC Banner

EXECUTE IMMEDIATE 11gR2 and Oracle Optimizer

edited May 23, 2013 5:30AM in SQL Performance (MOSC) 6 commentsAnswered
Hello,


I would like to know the difference between the 2 following requests with respect to the optimizer 11gR2.


Could you assure me that in the 2 cases, Oracle manages bind variables ?


Which are the benefits and disadvantages of each method in 11gR2 ?

Which is the impact on the statistics 11gR2 ?

Thank you.

GD.

-- Method 1
MERGE INTO T
USING VW
ON ( T.ID = VW.ID
AND T.status = p_status -- IN PARAMETER
)
WHEN MATCHED THEN UPDATE ... ;


-- Method 2
EXECUTE IMMEDIATE ('MERGE INTO T USING VW ON ( T.ID = VW.ID AND T.status = '|| p_status || -- IN PARAMETER
') WHEN MATCHED THEN UPDATE ...)' ;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center