PLSQL Stored Procedure Examples
PLSQL Stored Procedure Examples
Name : changesalary
Argument1 : empid
Argument2 :percentage of amount to hike
ANS:
create or replace procedure changesalary(ide number,ch_salary number) is sal number;
begin
select salary into sal from employee where employee.id=ide;
update employee set salary=(sal+sal*ch_salary*.01) where employee.id=ide;
end;
Exec changesalary(1,20);
3) Create function to return an inputted string in upper case and another in lower case
ANS:
Argument : String
Purpose : if inputted string is , east or west india is the best result would be
East Or West India Is The Best
ANS:
begin
dbms_output.put_line(init('kiren is'));
end;
Name : getEmailer
Argument1 : employee name
Return type : email address of this employee
ANS:
declare
mail varchar2(20);
begin
getemailer('arun',mail);
dbms_output.put_line(mail);
end;
Name : getAllEmails
ANS:
exec getallemail('arun');