Help Me/Question What Is Difference Between Embedded And Dynamic Sql?

steve taylor

White Belt
In Embedded SQL it include hard coded SQL statements. It stores the predefined same SQL statements for retrieving data from data base . These statements can not be change unless the source code is modified.

Dynamic SQL is the process of generating SQL command when it needed.The statements generated dynamically do not have to be the same each time.

Prasoon Arora

White Belt
In static SQL how database will be accessed is predetermined in the embedded SQL statement. In dynamic SQL, how database will be accessed is determined at run time. Parsing, validation, optimization, and generation of application plan are done at run time. Static SQL is less flexible. For dynamic sql the program must dynamically allocate memory to receive the query results. And Static sql is compiled and optimized prior to its execution where as dynamic is compiled and optimized during execution.