1.

Compare The Use Of Embedded Sql With The Use In Sql Of Functions Defined In A General-purpose Programming Language. Under What Circumstances Would You Use Each Of These Features?

Answer»

SQL functions are primarily a MECHANISM for extending the power of SQL to handle attributes of complex data types (like IMAGES), or to perform complex and non-standard operations. Embedded SQL is USEFUL when imperative actions like displaying results and interacting with the user are needed. These cannot be done conveniently in an SQL only environment. Embedded SQL can be used instead of SQL functions by retrieving data and then PERFORMING the function’s operations on the SQL result. However a drawback is that a lot of query-evaluation functionality may end up getting repeated in the HOST language code.

SQL functions are primarily a mechanism for extending the power of SQL to handle attributes of complex data types (like images), or to perform complex and non-standard operations. Embedded SQL is useful when imperative actions like displaying results and interacting with the user are needed. These cannot be done conveniently in an SQL only environment. Embedded SQL can be used instead of SQL functions by retrieving data and then performing the function’s operations on the SQL result. However a drawback is that a lot of query-evaluation functionality may end up getting repeated in the host language code.



Discussion

No Comment Found

Related InterviewSolutions