x

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.

more ▼

asked Dec 14, 2009 at 03:21 PM in Default

dbkid gravatar image

dbkid
131 9 10 11

(comments are locked)
10|1200 characters needed characters left

1 answer: sort oldest

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.

more ▼

answered Dec 14, 2009 at 04:12 PM

Dean Langford gravatar image

Dean Langford
111 1

Thanks a lot Dean Langford. Triggers solved my problem.
Dec 14, 2009 at 04:54 PM dbkid
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x378
x84

asked: Dec 14, 2009 at 03:21 PM

Seen: 612 times

Last Updated: Dec 14, 2009 at 03:21 PM