Hi, I have a question regarding pl/sql stored procedure.  I am trying to create a sp that takes 4 in and updates 3 columns. Below is my initial code. create or replace procedure update_job (p_jid in hr_jobs.job_id%type,  p_jt  in hr_jobs.job_title%type,  p_mins in hr_jobs.min_salary%type,  p_maxs in hr_jobs.max_salary%type)   is begin      update hr_jobs      set  job_title = p_jt,            min_salary = p_mins,            max_salary = p_maxs           where job_id = p_jid;     commit; end; And it gives me an error like this; Error report - ORA-00955: name is already used by an existing object 00955. 00000 -  "name is already used by an existing object" Can you help me with fixing my code or give me an idea how to solve this issue?

icon
Related questions
Question
100%

Hi, I have a question regarding pl/sql stored procedure. 
I am trying to create a sp that takes 4 in and updates 3 columns. Below is my initial code.

create or replace procedure update_job
(p_jid in hr_jobs.job_id%type,
 p_jt  in hr_jobs.job_title%type,
 p_mins in hr_jobs.min_salary%type,
 p_maxs in hr_jobs.max_salary%type)
 
is
begin 
    update hr_jobs 
    set  job_title = p_jt, 
          min_salary = p_mins, 
          max_salary = p_maxs
     
    where job_id = p_jid;
    commit;
end;

And it gives me an error like this;

Error report -
ORA-00955: name is already used by an existing object
00955. 00000 -  "name is already used by an existing object"

Can you help me with fixing my code or give me an idea how to solve this issue?

 

JOB_ID
1 AD_PRES
2 AD_VP
3 AD_ASST
4 FI_MGR
5 FI_ACCOUNT
6 AC_MGR
7 AC_ACCOUNT
8 SA_MAN
9 SA_REP
10 PU_MAN
11 PU_CLERK
12 ST MAN
13 ST_CLERK
14 SH_CLERK
15 IT_PROG
16 MK MAN
17 MK_REP
18 HR_REP
19 PR_REP
JOB_TITLE
President
Administration Vice President
Administration Assistant
Finance Manager
Accountant
Accounting Manager
Public Accountant
Sales Manager
Sales Representative
Purchasing Manager
Purchasing Clerk
Stock Manager
Stock Clerk
Shipping Clerk
Programmer
Marketing Manager
Marketing Representative
Human Resources Representative
Public Relations Representative
MIN_SALARY MAX_SALARY
20000 40000
15000
30000
3000
6000
8200
16000
4200
9000
16000
9000
20000
12000
15000
5500
8500
5000
5500
10000
15000
9000
9000
10500
8200
4200
10000
6000
8000
2500
5500
2000
2500
4000
9000
4000
4000
4500
Transcribed Image Text:JOB_ID 1 AD_PRES 2 AD_VP 3 AD_ASST 4 FI_MGR 5 FI_ACCOUNT 6 AC_MGR 7 AC_ACCOUNT 8 SA_MAN 9 SA_REP 10 PU_MAN 11 PU_CLERK 12 ST MAN 13 ST_CLERK 14 SH_CLERK 15 IT_PROG 16 MK MAN 17 MK_REP 18 HR_REP 19 PR_REP JOB_TITLE President Administration Vice President Administration Assistant Finance Manager Accountant Accounting Manager Public Accountant Sales Manager Sales Representative Purchasing Manager Purchasing Clerk Stock Manager Stock Clerk Shipping Clerk Programmer Marketing Manager Marketing Representative Human Resources Representative Public Relations Representative MIN_SALARY MAX_SALARY 20000 40000 15000 30000 3000 6000 8200 16000 4200 9000 16000 9000 20000 12000 15000 5500 8500 5000 5500 10000 15000 9000 9000 10500 8200 4200 10000 6000 8000 2500 5500 2000 2500 4000 9000 4000 4000 4500
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer