Skip to main content

Posts

Showing posts with the label dynamic sql

Dynamic SQL in Oracle PL/SQL #DOTC_Mdb

                                    Dynamic SQL in Oracle PL/SQL Hello Everyone, Today we will discuss about Dynamic SQL in Oracle PL/SQL and its benefits. Before reading this blog I will suggest you to see my previous blogs related with SQL and PL/SQL blog for better understanding as some of PL/SQL feature I will use in this blog. Let’s start to understand Dynamic SQL in Oracle. Dynamic SQL in Oracle PL/SQL used for generating and running SQL statements at run time. Through Dynamic SQL we can use DDL statements in PL/SQL block.   Dynamic SQL is useful when writing general-purpose and flexible programs like ad hoc query systems, when writing programs that must run database definition language (DDL) statements. We can write Dynamic SQL in two ways. 1. Native Dynamic SQL 2. DBMS_SQL 1. Native dynamic SQL in PL/SQL language enables for building and running dynamic SQL statements at run time. Dynamic SQL uses the EXECUTE IMMEDIATE command to create and execute the SQL at run ti