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

Home -> Community -> Usenet -> c.d.o.misc -> Re: 10.1 / 10.2: different trigger behaviour

Re: 10.1 / 10.2: different trigger behaviour

From: Tarby777 <tarbster_at_yahoo.com>
Date: 22 Jan 2007 03:18:57 -0800
Message-ID: <1169464737.033205.57680@a75g2000cwd.googlegroups.com>


> Posting the actual error message and possibly the trigger code would > make it possible for someone to help you.

OK, thanks. Here's the error:

716 rows created.
commit
*
ERROR at line 1:
ORA-02091: transaction rolled back
ORA-02291: integrity constraint (CHS.LIBRARYCONNECTOR_FK) violated - parent key not found

The "716 rows" message relates to the COMPONEN table. Here's the trigger:

create or replace trigger COMPONEN_T001 before insert or update of grpname on componen
for each row
declare
libcomp_id varchar2(64);
lib_count number;
libpincontainer_count number;
begin

  if inserting then
    if (:new.progress_recid is null) then       select componen_seq.nextval into :new.PROGRESS_RECID from dual;

      :new.classid := ' ';
    else

    end if;

    if ((:new.INTENUM is null) or (:new.INTENUM = 0)) then       select intenum_s.nextval into :new.INTENUM from dual;     end if;

  end if;

  select colcode into :new.colcode from colour where color_id = :new.color_id;
  select matcode into :new.matcode from material where material_id = :new.material_id;
  select typcode into :new.typcode from comptype where comptype_id = :new.comptype_id;

  :new.u##intepn := upper(trim(:new.intepn));
  :new.u##matihalf := upper(trim(:new.matihalf));
  :new.u##testblok := upper(trim(:new.testblok));
  :new.u##altepn := upper(trim(:new.altepn));
  :new.u##classid := upper(trim(:new.classid));
  :new.u##matcode := upper(trim(:new.matcode));
  :new.u##colcode := upper(trim(:new.colcode));
  :new.u##pnstatus := upper(trim(:new.pnstatus));
  :new.u##typcode := upper(trim(:new.typcode));
  :new.u##grpname := upper(trim(:new.grpname));

end;
/

Of the tables mentioned in the trigger, LIBRARYPINCONTAINER is the child of COMPONEN, and LIBRARYCONNECTOR is the child of LIBRARYPINCONTAINER. The constraint violation that I'm seeing when I populate COMPONEN is because the trigger is trying to create a LIBRARYCONNECTOR but there is no owning LIBRARYPINCONTAINER for it.

> constraints are deferrable on 1, not so on release 2

> your data is not the same; you overlooked something.

I don't think that either of these are possible in the test that I'm doing. I start out with a new user that has no schema whatsoever, and I load a dump file into it, giving me the schema and the data. However, to double-check, I ran a schema comparison utility between the r1 and r2 schemas before running the script, and it reported no differences. It would have picked up any extra / missing / changed objects.

Regards,
Tarby Received on Mon Jan 22 2007 - 05:18:57 CST

Original text of this message

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