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

which types of join is used in sql widely? : Sql dba

521


What is basic structure of pl sql?

473


Is clustered index a primary key?

509


Does truncate release storage space?

529


What are the types of views in sql?

509






How do you explain an index number?

509


What are different joins used in sql?

535


What is identity column in sql server?

495


what is datawarehouse? : Sql dba

548


what are all the common sql function? : Sql dba

555


How to get unique records from a table?

499


What is difference between cursor and trigger?

528


what is the functionality of the function htmlentities? : Sql dba

490


describe mysql connection using mysql binary. : Sql dba

519


why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba

532