Skip to Main Content

APEX

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!

Trigger for composite primary key

707404Jun 17 2009 — edited Jun 17 2009
Hi, i have a primary key which contains of two foreign keys. I'm trying to create a form and report page for that primary key. I have created triggers for each part of the key, and when i try to run the aplicaton I'm getting message "unable to fetch row". I'm new at this, so can please somebody help me. Maybe my triggers are not good, or something else. Foreign keys that primary key contains are ID_UTAKMICE and SIFRA_IGRACA.
Here are the triggers:

CREATE OR REPLACE TRIGGER "BI_DETALJI_UTAKMICE"
before insert on "DETALJI_UTAKMICE"
for each row
begin
if :NEW."ID_utakmice" is null then
select "DETALJI_UTAKMICE_SEQ".nextval into :NEW."ID_UTAKMICE" from dual;
end if;
end;

/
ALTER TRIGGER "BI_DETALJI_UTAKMICE" ENABL
/

The second trigger is the same, just SIFRA_IGRACA where ID_UTAKMICE.

Can somebody please help, regards Luka
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 15 2009
Added on Jun 17 2009
1 comment
406 views