Skip to Main Content

SQL & PL/SQL

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Execute Immediate in PL/SQL package

jflackAug 13 2021

I'm looking at a package that someone who is no longer with us wrote. It is full of EXECUTE IMMEDIATE staements that are running SQL commands that could easily have been written as static SQL, sometimes with bind variables that are currently being concatenated into the text to be executed.
Questions for you all: Is there some advantage to running dynamic SQL under certain circumstances? I don't think there is, but then... Were there some myths back in the past about dynamic vs. static that might have caused my predecessor to do this?
Just trying to decide if I should leave the code alone.

This post has been answered by Paulzip on Aug 14 2021
Jump to Answer
Comments
Post Details
Added on Aug 13 2021
10 comments
978 views