what is dynamic sql

Answer Posted / nilesh

Dynamic SQL enables you to write programs that reference
SQL statements whose full text is not known until runtime.
Before discussing dynamic SQL in detail, a clear definition
of static SQL may provide a good starting point for
understanding dynamic SQL. Static SQL statements do not
change from execution to execution. The full text of static
SQL statements are known at compilation, which provides the
following benefits:

Successful compilation verifies that the SQL statements
reference valid database objects.
Successful compilation verifies that the necessary
privileges are in place to access the database objects.
Performance of static SQL is generally better than dynamic
SQL.
Because of these advantages, you should use dynamic SQL
only if you cannot use static SQL to accomplish your goals,
or if using static SQL is cumbersome compared to dynamic
SQL. However, static SQL has limitations that can be
overcome with dynamic SQL. You may not always know the full
text of the SQL statements that must be executed in a
PL/SQL procedure. Your program may accept user input that
defines the SQL statements to execute, or your program may
need to complete some processing work to determine the
correct course of action. In such cases, you should use
dynamic SQL.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dependency injection in simple words?

701


What is boolean method?

707


What is the use of list in c#?

648


What is property c#?

697


Why are strings in c# immutable?

701


Is inheritance possible in c sharp?

836


Can constructor be private c#?

648


What does readonly mean in c#?

747


Do events have return type c#?

701


What is the base class for array types?

771


What are generations and how are they used by the garbage collector?

713


Is linkedhashset synchronized?

814


How to block a class from being inherited further?

670


Can a struct inherit from an interface in c#?

731


Explain why do I get an error (cs1006) when trying to declare a method without specifying a return type?

640