Question: Q 2 . ( total 4 0 points ) Function overload. Based on table employees We have used some overloaded functions, such as the function

Q2.(total 40 points) Function overload. Based on table employees
We have used some overloaded functions, such as the function TO_CHAR. This question will provide a chance for you to practice. As we do not discuss package yet, this overload must be competed in one PL/SQL block, cannot use two "create" separately.
Q2.a (15 points) On page 4, note6_Records, in Example 3, we have defined a user defined record type Emp_Sal. We will re-use these codes. InQ2.a, you will write a PL/SQL block, the program will define a record type Emp_Sal same as in example 3. Also you will define a function called Get_Emp_Sal with one IN parameter called Emp_id which has the number as data type. This function will get the employee_id, the return a variable of the Emp_Sal record type. In the executable section, your program will invoke this function will a value of 105 as employe ID, then print out the record information. The output is similar/same as that in the example 3.
Q2.b.(10 points), Almost same as in Q2.a. You will write a PL/SQL block. The program will define the record type Emp_Sal as in example 3. Also you will define a function called Get_Emp_Sal with one IN parameter, but this time, the IN parameter will be called Emp_email which has the data type of varchar2. The function will the return a variable of the Emp_Sal record type. In the executable section, your program will invoke this function will a value of 'DAUSTIN' as employe email, then print out the record information. The output is similar/same as that in Q2a.
Q2c.(15 points) Based on the codes in Q2.a and Q2.b, you will write one PL/SQL block. In the program, you will define a record type Emp_Sal same as in example 3. Also you will define a function called Get_Emp_Sal with one IN parameter called Emp_id; also you will define the function name as Get_Emp_Sal, but with one IN parameter called Emp_email.
In the executable section in the PL/SQL, it will get all the employee id for the worker in department 60, Your program will invoke the function, then print out the information about the records for all these people.
Then your program will get all the emails for people who work in department 30. Your program will invoke the function, then print out the information about the records for all these people.
 Q2.(total 40 points) Function overload. Based on table employees We have

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!