View the Exhibit to examine the PIVSQL block.
Which statement is true about the output of the PL/SQL block?
A. It executes and the Output is emprec.deptname: .
B. It executes and the Output is emprec.deptname: Sales.
C. It produces an error because NULL is assigned to the emprec.empid field in the record.
D. It produces an error because the CHECK constraint is violated while assigning a value to the emprec.deptid field in the record.
A is correct.
EMPREC does not inherit constraints from employees_temp table.
create table employees_temp(
empid number(6) not null primary key,
deptid number(6) constraint c_employees_temp_depid check (deptid BETWEEN 100 and 200),
deptname varchar2(30) default ‘Sales’
);
declare
emprec employees_temp%ROWTYPE;
begin
emprec.empid := NULL;
emprec.deptid := 50;
DBMS_OUTPUT.PUT_LINE(’emprec.deptname: ‘||emprec.deptname);
end;
/
drop table employees_temp;