The record for the employee with employee__id 100 in the employees table is as follows; Identify the correct output for the code.

View the Exhibit to examine the PL/SQL code.

The record for the employee with employee__id 100 in the employees table is as follows;

Identify the correct output for the code.

View the Exhibit to examine the PL/SQL code.

The record for the employee with employee__id 100 in the employees table is as follows;

Identify the correct output for the code.

A.
King 17-JUN-87 1500

B.
King17-JUN-87 24000

C.
King current sysdate 1500

D.
King current sysdate 24000



Leave a Reply 17

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


Tr

Tr

C
minsal = 1000, later adds 500
and sets hire_date to sysdate
so there you get King sysdate 1500

Rose

Rose

A
to_char(v_hire_date)=17-JAN-87

Uladzimir

Uladzimir

Rose, you are wrong
there 2 dates
1) v_myrec.v_hire_date = sysdate
2) v_myrec.v_rec1.hire_date = 17-jan-87

piero

piero

C

hi, when you want intend as a result , sysdate, please, be more able to explain it.

to my eyes, and mind , the result proposed
king current sysdate 1500
appeared as
king ‘current sysdate’ 1500
and on the contrary…

nothing gave me to intend that 17-JUN-87 couldn’t be the current date of the xecution of the test….

irfan

irfan

C

declare
type t_rec is record
(v_Date employees.hire_Date%type,
v_rec1 employees%rowtype);

v_myrec t_rec;
begin
v_myrec.v_date := sysdate;
select * into v_myrec.v_rec1 from employees where employee_id = 100;
dbms_output.put_line(v_myrec.v_date);
end;

Sufiyan Shaikh

Sufiyan Shaikh

declare
type t_rec is record
(v_sal number(8),
v_minsal number(8) default 1000,
v_hire_date employees.hire_date%type,
v_rec1 employees%rowtype);
v_myrec t_rec;
begin
v_myrec.v_sal := v_myrec.v_minsal + 500;
v_myrec.v_hire_date := sysdate;
select * into v_myrec.v_rec1
from employees
where employee_id = 100;
dbms_output.put_line(v_myrec.v_rec1.last_name||’ ‘||to_char(v_myrec.v_hire_date)||’ ‘||to_char(v_myrec.v_sal));
end;

output : King 03-OCT-15 1500 ie current date or sysdate

Tested and Verified

Correct answer is C.

If anyone having doubts I will suggest them to copy this code and verify it.

Andreea

Andreea

C is the correct answer

Google

Google

Usually posts some pretty intriguing stuff like this. If you are new to this site.