Examine the following snippet of code from the DECLARE section of PL/SQL
DECLARE
Cust_name VERCHAR2 (20) NOT NULL : = ‘Tom Jones’:
Same_name cust_name%TYPE:
Which statement is correct about the above snippets of code?
A.
TheSAME_NAMEvariable inherits only the data type from the CUST_NAME variable.
B.
TheSAME_NAMEvariable inherits only the data type and default value from the CUST_NAME
variable.
C.
TheSAME_NAMEvariable inherits the data type, constraint, and default value from the
CUST_NAME variable.
D.
TheSAME_NAMEvariable inherits only the data type and constraint from the CUST_NAME
variable resulting in an error
D
D
d
D
An item declared with %TYPE (the referencing item) always
inherits the data type of the referenced item.
The referencing item inherits the constraints only if the referenced item
is not a database column.
The referencing item inherits the default value only if the referencing item
is not a database column and does not have the NOT NULL constraint.
So C is also incorrect.
C is also incorrect. It will not inherit the default value because of the NOT NULL constraint
07:38:56 PLS-00218: a variable declared NOT NULL must have an initialization assignment
D
confirm: D