top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How embedded SQL differ from dynamic SQL?

+1 vote
571 views
How embedded SQL differ from dynamic SQL?
posted Sep 27, 2013 by Vivek Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

the difference between the embedded and dynamic sql is as follows.

(1) the embedded means to coding the sql query in the general purpose programing language.and programmer must access to a database

from general purpose programming language its called the embedded sql.

-->the dynamic sql means component of sql allows program to construct and submit sql queries at run time it's called the dynamic sql.

(2)embedded sql statement must be completely present at the compile time.

-->while in the dynamic sql statement not present compile time only present at run time pehapes based on user input.

answer Sep 27, 2013 by anonymous
+1 vote

The difference between embedded SQL and dynamic SQL is in when Caché resolves the SQL:

For dynamic SQL, the SQL is parsed at run time when it is prepared. This allows the SQL to be customized based on feedback from the application. This flexibility comes with a cost. Parsing the SQL is additional overhead, and the first time a dynamic query is run, Caché needs to generate the cached query for the SQL. The cached query is designed to be reused, so you only have this second cost once for each SQL statement.
Embedded SQL is parsed and compiled at routine/class compile time, so it cannot be changed by input from the application. Values in the WHERE clause can be changed, of course, but, at run time, you cannot add new conditions and you cannot change the SELECT list.
While the gap in performance between dynamic SQL and embedded SQL is getting smaller, embedded is still faster. If you do not need dynamic SQL but still want to use result sets instead of dynamic SQL, you could define the SQL in a class as a class query or as a class method that returns a result set. This removes the overhead of parsing the SQL at run time.

answer Sep 28, 2013 by Arvind Singh
Similar Questions
+1 vote

Assume there is one database in a system having multiple processes that are accessing this database.
If one process updates database table other processes should be notified. If someone has MySql C APIs document please send me.
Thanks in advance.

...