# SQL HELP-ORA-04073 column list not valid for this trigger type



## Akumos (Apr 22, 2010)

Hi,

After trying to create this trigger:

CREATE OR REPLACE TRIGGER a
AFTER INSERT OF duration, startdate ON route, outing
FOR EACH ROW
WHEN (NEW.startdate LIKE %jan%)
AND (NEW.duration = 5)
DECLARE
 closed_in_jan EXCEPTION;

EXCEPTION
WHEN closed_in_jan THEN
RAISE_APPLICATION_ERROR (-20101,We are closed in January.');



I get this error:

ORA-04073 column list not valid for this trigger type 
Cause
A column list was specified for a non-update trigger type. 

Action
Remove the column list. 


I've tried researching but can't find out what a column list is!

Any help would be appreciated, thanks.


----------



## Tatty_One (Apr 22, 2010)

This help?

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=67631


----------



## Kreij (Apr 22, 2010)

Hmmm ... Triggers can only be assigned to one table I beleive.
Are you sure you want to throw the exception AFTER the Insert and not BEFORE?
What about on UPDATES?


```
CREATE OR REPLACE TRIGGER a
BEFORE INSERT OR UPDATE OF duration, startdate ON route
FOR EACH ROW
DECLARE 
    closed_in_jan EXCEPTION;
BEGIN
   IF (startdate LIKE %jan% AND duration = 5)
       RAISE closed_in_jan;
   END IF;
EXCEPTION
   WHEN closed_in_jan THEN
        RAISE_APPLICATION_ERROR (-20101,We are closed in January.');
END;
```


----------

