create or replace function givegrade(p in number) return char is g char(15);
begin
if p >= 70 then
g:='Distinction';
return g;
elsif p >= 60 then
g:='First';
return g;
elsif p>= 50 then
g:='Pass';
return g;
else
g:='Fail';
return g;
end if;
end;
error given
======================
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'or'.
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'then'.
Msg 178, Level 15, State 1, Line 6
A RETURN statement with a return value cannot be used in this context.
Msg 132, Level 15, State 1, Line 8
The label 'g' has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 178, Level 15, State 1, Line 9
A RETURN statement with a return value cannot be used in this context.
Msg 132, Level 15, State 1, Line 11
The label 'g' has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 178, Level 15, State 1, Line 12
A RETURN statement with a return value cannot be used in this context.
Msg 132, Level 15, State 1, Line 14
The label 'g' has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 178, Level 15, State 1, Line 15
A RETURN statement with a return value cannot be used in this context.