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

Are stored procedures faster than queries?

0 Answers  


How do I create a sql script?

0 Answers  


What are wait events. Describe the wait event tables.

1 Answers   CTS,


What is hibernate and its relation to sql?

0 Answers  


What is the importance of sqlcode and sqlerrm?

0 Answers  






what is an associative array with example?

1 Answers  


I want to create synonym for table emp but in my pc it is giving insufficient previliges.I am using user scott.Please suggest me.

3 Answers  


If you want a column to be part of the result set, after which SQL keyword does it belong? 1. SELECT 2. FROM 3. WHERE 4. GROUP BY 5. HAVING

10 Answers   HCL, TCS,


i have doubt that any one tell ref cursor comes in sql pl/sql? pls clarify?

4 Answers   Tech Mahindra,


how to debugg a procedure or package using dbms_output.put_line in plsql

1 Answers   Polaris,


How to select unique records from a table?

0 Answers  


Can we use having without group by in sql?

0 Answers  


Categories