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.
You might also like to view...
A background ________ is a slide background fill variation that combines theme colors in different intensities or patterns
Fill in the blank(s) with correct word
Match the discovery process to its definition
I. Depositions A. Involve the inspection of documents II. Interrogatories B. Out-of-court testimony made under oath III. Requests for production C. Intend to ascertain the validity of documents IV. Requests for admission D. Written answers made under oath
By default, all three tunnel types are enabled when Windows Server 2016 is configured as a VPN server.
Answer the following statement true (T) or false (F)
The ____ form object attribute, when selected, indicates that the form object must contain a value.
A. Not Null B. Value C. Disabled D. Required