On Oct 6, 3:54 pm, "Michael Moore" <[EMAIL PROTECTED]> wrote:
> Maybe I missed something here, but why not just make it AFTER INSERT? just
> do...
>
> create or replace trigger checkDepartment
> AFTER insert on dept for each row
> pragma autonomous_transaction;
> begin
>
>        INSERT INTO dept_audit
>                (deptno, dname, loc, tot_emps, tot_sals)
>        VALUES
>                (:new.deptno, :new.dname, :new.loc, :new.tot_emps,
> :new.tot_sals);
>        commit;
>
> end;
> /
>
> If deptno is a primary key, and you attempt to insert a duplicate dept, this
> trigger will not get executed.
>
>
>
>

He's trying to use a trigger and a procedure to enforce uniqueness in
the DEPTNO column without using a primary key/unique constraint, and
it won't work.  I don't know what he's planning on doing with the
example I posted  ("I will go over the solution that you publish and
see what I can extract to enhance what I created... ") but if he's
trying to continue using the trigger/procedure absent any unique/pk
constraints he'll fail, as I've already illustrated.


David Fitzjarrell
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to