Which statement is correct about the above snippets of code?

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?

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



Leave a Reply 10

Your email address will not be published. Required fields are marked *


Alisa

Alisa

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.

swamy

swamy

So C is also incorrect.

swamy

swamy

C is also incorrect. It will not inherit the default value because of the NOT NULL constraint

Balthazar

Balthazar

07:38:56 PLS-00218: a variable declared NOT NULL must have an initialization assignment

giosefer

giosefer

confirm: D