PL/SQL Function to Display City of Employee

PL/SQL Function to Display City of Employee:

create or replace function get_city(vid in number)
return varchar is ciity varchar(15);
begin
select city into ciity from employee e,address a where a.eid=e.id and e.id=vid;
return(ciity);
end;

Calling Function:

begin
dbms_output.put_line(get_city(1));
end;

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.