These are the errors that I got. https://i.sstatic.net/hBB2e.png
The question asked for people who is born after 30th June 1990 to take injection. It asks the user to enter his/her id. I got error saying that 'literal does not match format string'. I don't know how to return varchar in plsql function. Here is my code:
create or replace function p_immune (ptdob in date)
return varchar2
is sta_imm varchar2(30);
BEGIN
if ptdob > '30th June 1990 ' then sta_imm := 'REQUIRED';
else sta_imm := 'NOT REQUIRED';
end if;
return(sta_imm);
END p_immune; /
Accept pt_id prompt 'Enter the patient ID: '
DECLARE
v_dob patient.ptdob%type; v_ptdob patient.ptdob%type;
BEGIN
select ptdob
into v_dob
from patient
where pt_id = &pt_id;
dbms_output.put_line('Enter the patient ID: '||&pt_id);
dbms_output.put_line('The status of X-immunization :'||p_immune(v_ptdob));
END; /