Answer Posted / naresh
Basically Dynamic SQL means, you'll construct a SQL
statement dynamically while runtime and run it.
Why this needed: Since the stored database objects
(Procedures and Functions and others) will be compiled while
creating and stored inside a database.so everything has been
checked already. so whenever you make a call to these
programs they will directly run withou compiling second time.
since it runs without compiling you cannot use DDL commands
inside a stored program.
So to avoid this you can directly mention Execute Immediate
keywords in front of a SQL query dynamically in your
block.so that it'll work this time.
Hope this helps.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is nosql vs sql?
how to create a new table by selecting rows from another table in mysql? : Sql dba
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
What are %type and %rowtype for?
What is a temp table?
Why sql query is slow?
What is form and report?
What is sqlcommand?
Explain the uses of a database trigger?
how can we know the count/number of elements of an array? : Sql dba
Which data dictionary views have the information on the triggers that are available in the database?
What are pl sql data types?
What are the main features of cursor?
What are different types of functions in sql?
How many types of literals are available in pl sql?