Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: O8: Can't create triggers
A copy of this was sent to "Ken Rachynski" <krachyn_at_cadvision.com>
(if that email address didn't require changing)
On Fri, 9 Oct 1998 16:30:22 -0600, you wrote:
>Good day,
>
>I have been trying without luck to figure out why my triggers won't compile
>at all. I am trying the following trigger:
>
>CREATE OR REPLACE TRIGGER COMMS_KEY_BEF_INS_ROW
>BEFORE INSERT ON COMMS_KEY
>FOR EACH ROW
>BEGIN
> :NEW.COMM_ID := SEQ_COMMS_KEY.NEXTVAL;
you cannot access a sequence like that -- the sequence is a database object.
you must select a sequence. the above would be:
select seq_comms_key.nextval into :new.comm_id from dual;
> :NEW.ENTRY_DATE := SYSDATE;
> :NEW.ENTRY_BY := USER;
>END;
>
>This is a fairly new installation of Oracle 8.0.4.0. Looking at my trigger,
>it is formatted properly for access, although I'm not sure about the
>sequence. I did check the documentation on the error I was receiving
>(trigger created with compilation errors) and ran the script that apparently
>I'm supposed to know about. Other ideas on this?
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Sun Oct 11 1998 - 07:30:29 CDT