Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions