|Subject||Re: Delete trigger trickery|
> > CREATE TRIGGER LEVELS_TG_BD FOR LEVELSHi Alan,
> > BEFORE DELETE
> > AS
> > begin
> > if (exists(select 1 from JOBS where LVL = old.LVL)) then
> > exception CANT_DELETE_LEVEL;
> > end^
> > The exception fires every time I try to delete a row from LEVELS,
> > even when there's patently no JOBS entry using that LEVEL.
> you'll always be able to select 1 from a table.
> select first 1 from JOBS
I guess you meant select first 1 1 from JOBS, which I've just
tried, but no change.
Could you explain please...
> you'll always be able to select 1 from a table.Doesn't this depend on having rows that satisfy the WHERE condition?