Chapter 8: SQL Functions and Procedures
70. In SQL Server, the cursor property ____________________ means that the cursor is used for retrieval purposes only.
71. In Microsoft Access, programs are written in ____________________, which does not support embedded SQL
commands directly in the code.
72. A(n) ____________________ is a procedure that is executed automatically in response to an associated database
operation, such as an INSERT, UPDATE, or DELETE command.
73. What is the difference between a nonprocedural language and a procedural language? Give an example of each.
A nonprocedural language is one in which you communicate tasks to the computer using simple
commands. A procedural language is one in which you must give the computer a step-by-step process
for accomplishing a task.
SQL is a nonprocedural language and PL/SQL (and T-SQL) are examples of procedural languages.
74. Name two reasons for creating a stored procedure.
1. improved overall performance because users execute the compiled, optimized code
2. convenience
75. What are the three advantages of cursors?
1. Coding in the procedure is greatly simplified.
2. In a normal PL/SQL program, the programmer must determine the most efficient way to access the
data. In a program using embedded SQL, a special component of the database management system
called the optimizer determines the best way to access the data.
3. If the database structure changes in such a way that the necessary information is still obtainable using
a different query, the only change required in the program is the cursor definition. The procedural code is
not affected.