What are advantages of %TYPE attribute in variable declaration?

What will be an ideal response?

PL/SQL uses %TYPE attribute to anchor a variable’s data type. Another variable or a
column in a table can be used for anchoring. In anchoring, you tell PL/SQL to use a
variable or a column’s data type as data type for another variable in the program. 
Suppose you do not use the anchoring method to declare variables, which are assigned
values directly from table columns. You use the DESCRIBE command to list all the data
types for columns. Then you declare variables in a program with the same types and
lengths. It will work just fine. The problem will arise when the column lengths are
increased to meet future demands. When you assign values from those columns to
variables, VALUE_ERROR will occur. You will have to go back to all the programs to
change the variable’s data length! Anchoring definitely is an advantage in such situations.
%TYPE anchors the data type of one variable based on another variable or column at the
time of a PL/SQL block’s compilation. If source or original column’s data type is
changed, the PL/SQL block must be recompiled in order to re-anchor all anchored
variables.

Computer Science & Information Technology

You might also like to view...

int[] numList = new int[50];for (int i = 0; i < 50; i++)    numList[i] = 2 * i;num[10] = -20;num[30] = 8;What is the index number of the last component in the array numList seen in the accompanying figure?

A. 0 B. 30 C. 49 D. 50

Computer Science & Information Technology

Because there is a one-to-many relationship between sales reps and customers in the Premiere Products database, one sales rep can be associated with zero, one, or more customers.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology