Hi here is a code for trigger and it have a for loop. When trigger is fired ( INSERT OR UPDATE)there's another table data must include it is MICL_SUP
OPEN projMgrsCursor;
LOOP
FETCH projMgrsCursor INTO projMgr;
select micl_sup_id_seq.nextval into SUPID from dual;
insert into MICL_SUP VALUES ((SUPID), (SELECT SYSDATE FROM DUAL), :NEW.ENTRYADDEDBY_EMP_NO, 3000, 0,projMgr, NULL,:NEW.EMP_NO);
END LOOP;
CLOSE projMgrsCursor;
This is the table structure . Sup_ID
primary and unique key . I cant do any changers to table structure
SUP_ID -primary key
ASSIGNED_DATE
ASSIGNED_BY_EMP_NO
AMOUNT_LIMIT
IS_OVVERRIDDEN
SUP_EMP_NO
RTD_EMP
EMP_NO
To enter sup_ID I use select micl_sup_id_seq.nextval into SUPID from dual;
but when I run this code there's an error "RA-00001: unique constraint violated"
(this is not a compilation error ) Is there any other way to add sup_ID ?? where i went wrong ?? pls help me Im going to loose my job because of this trigger and Im a newbie
thank in advance Urgent Help needed
this Question is related with this trigger PlSQL trigger error ORA-0000 ORA-06512: