Thursday, February 28, 2019

Dynamic Magic Using DBMS_SQL

Dynamic SQL/PLSQL is considered one of the most advanced topics in Oracle PL/SQL. Even though it's not a new topic at all, it's still one of the most challenging concepts to digest and master.

Dynamic SQL is simply any part of your SQL code that is not written explicitly before compiling. So, for instance, if you do not know the "WHERE" predicate in a SQL query, then you have to use dynamic SQL. Oracle gives us two distinct ways to build dynamic SQL/plsql code, and the first one is the NativeDynamic SQL (NDS). Using the elegant and easy-to-use EXECUTE IMMEDIATE and OPEN.. FOR statements, this method is more than enough in over 90 percent of scenarios. But what about the remaining 10 percent? Here is where it gets a little more complex.



from DZone.com Feed https://ift.tt/2UcXI1p

No comments:

Post a Comment