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 is a scheduled jobs or what is a scheduled tasks? : Sql dba

554


Can sql developer connect to db2?

587


What is record type in pl sql?

550


Is pl sql a scripting language?

592


Is sql a oracle?

527






Does a primary key have to be a number?

522


Define select, insert, create, delete, update, drop keywords

600


Explain cursor types?

581


Why plvtab is considered as the easiest way to access the pl/sql table?

621


What is the use of stored procedures?

519


What is date functions?

577


how many sql ddl commands are supported by 'mysql'? : Sql dba

528


What does select * from mean in sql?

1994


Give the order of sql select?

614


Is not equal in sql?

571