what are Dynamic SQL statements?

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


Please Help Members By Posting Answers For Below Questions

What are aggregate functions in sql?

838


How do you select unique values in sql?

698


what is msql? : Sql dba

751


Mention what does plv msg allows you to do?

854


Can we rename a column in the output of sql query?

725






What is the difference between in and between in sql?

772


Does sql support programming?

767


What is function and procedure in pl sql?

701


What is a file delimiter?

742


What is sap sql anywhere?

679


What is difference sql and mysql?

702


What is pl sql architecture?

681


what are the types of join and explain each? : Sql dba

768


Explain ddl statements in pl/sql?

734


Does access use sql?

750