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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

AFTER INSERT TRIGGER with Condition

user8987217Jun 5 2015 — edited Jun 5 2015

I am new to PL/SQL programming and i've been task to create a simple trigger; see code below:

CREATE OR REPLACE TRIGGER  TRG_ACCT_IDW

AFTER INSERT ON ACNTGROUPS

FOR EACH ROW

BEGIN INSERT

INTO IDWORKS_HC (ACCOUNT,IDW_CATEGORYNO,GRTYPE)

VALUES

(:NEW.ACCOUNT,:NEW.GROUP_,:NEW.TYPE)

WHERE ACNTGROUPS.TYPE = '1'

END;

Everything works great without the where clause. Can an 'after insert' trigger have a condition clause? does my code above need reformating? thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 3 2015
Added on Jun 5 2015
10 comments
11,781 views