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

How many types of index are there?

633


Is oracel sql developer written in java?

750


Is a table valued function object?

678


How delete all records from table in sql?

642


Explain how exception handling is done in advance pl/sql?

628






How many joins can you have in sql?

623


How many primary keys can a table have?

609


Can we alter stored procedure?

635


How do I find duplicates in two columns?

656


What does joining a thread mean?

640


What is %type in sql?

606


What is data types in sql?

620


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

648


What are the features of pl sql?

668


How do you copy a table in sql?

658