Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Company Database Employee Empno Ename Job MGR Hiredate Sal Comm DeptNo 17-Nov-81

ID: 3912534 • Letter: C

Question

Company Database Employee Empno Ename Job MGR Hiredate Sal Comm DeptNo 17-Nov-815000 10 30 10 7839 King President 7698 Blake Manager 783901-May-812850 7782 Clark Manager 7839 09-Jun-81 2450 7566 Johns Manager 7654 Martin Salesman 769828-Sep-8250 430 7499 Allen Salesman 7698 20-Feb-811600 7844 Turner Salesman 769808-Sep-811500 7900 James Clerk 7521 Ward Salesman 7698 22-Feb-81 1250 7902 Ford 7369 Smith Clerk 7788 Scott Analyst 7566l09-Dec-823000 7876 Adams Clerk 7934 Miller Clerk 300 30 030 30 500 30 7698 03-Dec-81950 nalyst 7566 03-Dec-81 3000 7902 17-Dec-80 800 7788 12-Jan-83 1100 7782 23-Jan-82 1300 10 Department Location DeptNo Dname 10 20 30 40 Accounting Aim Research Sharajah Sales Operations Dubai an Abu Dhabi

Explanation / Answer

Hello there,

Here i am writing the stored procedure to update the record and along with the pl/sql block that will call the stored procedure to update.

Stored_Procedure :

create or replace procedure "UPD_JOB"
(id IN NUMBER,
title IN VARCHAR2)
is
begin
update JOBS set job_title = title where job_id = id;
end;

pl/sql block:

BEGIN
UPD_JOB(101,'developer');
dbms_output.put_line('record updated successfully');
END;

Explanation:

in the stored procedure, we have named our procedure with UPD_JOB, then it accept parameters, in the form of IN and OUT, in for input parameters and out for output parameters, in our case we required only input parameters, after that in the block of begin and end, i have written the update query.

then in the next, i have written the pl/sql block or program, which will call the above procedure to update the record for job_id 101, it will update job_title as 'developer', we passed the input parameters,and the it will update the record.

Hope, you got the answer, feel free to ask any doubt.

Thank you

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote