Subject Re: Delete trigger trickery
Author sdbeames
> > CREATE TRIGGER LEVELS_TG_BD FOR LEVELS
> > 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.
> Try
> select first 1 from JOBS
> Alan

Hi Alan,
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?

Thanks,
Steve