Can we have exception part in trigger ?



Can we have exception part in trigger ? ..

Answer / kishore

yes........

create or replace trigger emp_biu
before insert or update on employee
referencing new as new old as old
for each row
begin
if nvl(:new.salary,0) >= 10000 then
raise_application_error (-20999,'Salary with
commissions should be less than 10000');
end if;
end;
/

Is This Answer Correct ?    15 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

write a procedure to print a statement or number not using "dbms_output.put_line" package.write a procedure instead of it using procdure name as "print" ex:- declare a number:=2; begin print(a); end; /* when U type above procedure 2 have to should be printed*/

2 Answers   iFlex,


How to maintain the history of code changes of pl/sql?

3 Answers  


Is nosql faster than sql?

0 Answers  


discuss about myisam key cache. : Sql dba

0 Answers  


How many developers work on postgresql?

0 Answers  






What are predefined functions in sql?

0 Answers  


what is a relationship and what are they? : Sql dba

0 Answers  


How do I run a sql trace?

0 Answers  


Where are my tempfiles, I don't see them in v$datafile or dba_data_file?

0 Answers  


What is the Diff b/w Constraints and Trigeer

4 Answers   HCL,


Why we use join in sql?

0 Answers  


how to connect oracle in unix prompt?

4 Answers   Polaris,


Categories