Explanation Function Plsql
Explanation Function Plsql
Assignment:
Create a function to concatenate the first name and Last name of an employee.
Create a function that calculate the annual salary based on the monthly salary input and test the function.
Execution of function
Set serveroutput on
Declare
Square number;
Begin
Square:=cal_sqr(5);
DBMS_OUTPUT.PUT_LINE('square is ' ||square);
End;
/
Create a function to concatenate the first name and Last name of an employee.
CREATE or replace FUNCTION name_concat
( fname in varchar2,
Lname in varchar2) return varchar2
Is
result varchar2(100);
Begin
result :=fname|| ' ' ||lname;
Return result;
End;
/
Execution of function
Set serveroutput on
Declare
Name varchar2(100);
Begin
Name:=name_concat(' raj', ' jadhav');
DBMS_OUTPUT.PUT_LINE('FULLNAME is ' ||Name);
End;
/
Create a function that calculate the annual salary based on the monthly salary input and test the
function. (DO it YOURSELF)