Examine the following command to create the table EMPLOYEES_TEMP and the PL/SQL block.
CREATE TABLE employees_temp (empid NUMBER(6) NOT NULL,
deptid NUMBER(6) CONSTRAINT c_emp_deptid CHECK (deptid BETWEEN 100 AND 200),
salary Number(8),
deptname VARCHAR2(30) DEFAULT ‘Sales’)
/
DECLARE
SUBTYPE v_emprec_subtype IS employees_temp%ROWTYPE;
v_emprec v_emprec_subtype;
BEGIN
v_emprec.empid := NULL; v_emprec.salary := 10000.002;
v_emprec.deptid := 50;
DBMS_OUTPUT.PUT_LINE(‘v_emprec.deptname: ‘ || v_emprec.deptname);
END;
/
Which statements are true about the above PL/SQL block? (Choose two.)
A.
V_EMPREC.DEPTNAME would display a null value because the default value is not inherited.
B.
Assigning null to V_EMPREC.EMPID would generate an error because the null constraint is inherited.
C.
Assigning the value 1000.002 to V_EMPREC.SALARY would generate an error because of the decimal.
D.
Assigning the value 50 to V_EMPREC.DEPTID would work because the check constraint is not inherited.
A,D
C) is incorrect, because there would be one implicit conversion to remove the decimal and just keep precision.