Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Trigger & Sequence

Trigger & Sequence

From: Oliver Neumann <tha.beast_at_web.de>
Date: Mon, 13 Feb 2006 21:50:05 +0100
Message-ID: <dsqr55$1s3$03$1@news.t-online.com>


Hey there,

i using Oracle Database 10g and im new to these sequences and trigger-stuff. Now i got an issue that you might be able to help me with.

i have created this sequence:

CREATE SEQUENCE "AUTOINCRSEQ" INCREMENT BY 1 START WITH 1 NOMAXVALUE NOMINVALUE NOCYCLE NOORDER Afterwards i setted this trigger:

create trigger "AUTOINC_OBJECT_TEAMS_CLIENT" before insert on OBJECT_TEAMS_CLIENT
for each row begin

    select AUTOINCRSEQ.nextval into :new.CLIENT_ID from dual; end;/
GO

On both executions i receive this "error": Describe Error: Failed to execute EXPLAIN plan: ORA-00900: invalid SQL statement

But he created both, the sequence and the trigger in the db. When i try to insert a row now in the trigger-sensitive Table OBJECT_TEAMS_CLIENT i receive this error:

Error: Query(1/1) ORA-04098: trigger 'SYSMAN.AUTOINC_OBJECT_TEAMS_CLIENT' is invalid and failed re-validation

Is someone able to help me out with this ? I have these statements copied from a site (http://www.mitlinx.de/tricks/autoincrement_workaround.htm - german)...and the purpose of this sequence is an autoIncrementor for my PrimaryKey-Column in the table, named CLIENT_ID.

any help is highly appreciated! thanks and greets, oliver Received on Mon Feb 13 2006 - 14:50:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US