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 the difference between console and windows application?

445


What is void method?

480


What is c# used for?

503


Is int reference type c#?

495


You are creating a custom usercontrol, some of the newly created properties are shown in the properties window. How you can hide a new property named theme from the properties window?

490






Is a char?

451


Can we create extension method for interface?

484


Contrast System.String and System.Text.StringBuilder classes?

516


What is the purpose of abstract class in c#?

482


What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?

542


How to override a function in c#?

534


What are tuples c#?

491


Is constructor a static method?

481


Can destructors have access modifiers?

556


What is the difference while using directive vs using statement ?

504