Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Exception vs Raise_application_error

AHMAD ELSAEDIMay 13 2016 — edited May 13 2016

Hi

I do not understand what is the wright place to use raise_application_error

this is a sample code of a procedure , if i use an exception (when no data found ) ,nothing happen  when the procedure get executed with invalid parameters:

Thanks

create or replace procedure upd_job(p_jobid     JOBS.JOB_ID%type,

                                    p_new_title JOBS.JOB_TITLE%type)

is

begin

update jobs

set job_id=p_jobid

where

job_title=p_new_title;

if sql%notfound then

raise_application_error('-20201','no job updated');

--exception

--when no_data_found then

--dbms_output.put_line('sqlerrm');

end if;

end upd_job;

execute upd_job('IT_WEB','Web Master');


Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2016
Added on May 13 2016
2 comments
950 views