question

dbkid avatar image
dbkid asked

Action initiation after inserting a record in a table?

I am having a table EMPLOYEE. In that, we have list of all employees in that table.

We have Emp No, Name, Gender, Salary, Joining date , Valid_Employee columns.

When there is a female employee entry in a table, I want to do set of actions. Such as insertion of another entry in another table.

Is there any way we can acheive this in oracle?

I am using oracle 10g.

oracletable
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Dean Langford avatar image
Dean Langford answered

You want to create a trigger on the table.

Introduction to Triggers

You can either have the trigger only fire if the employee is a female using the WHEN clause, or use an IF...THEN in the trigger body.

1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks a lot Dean Langford. Triggers solved my problem.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.