I need ID to be an eight whole digit number.
create table foo(
ID primary key DEFERRABLE,
);
create or replace trigger foo_trg
before insert or update
on foo
for each row
Begin
if :new.ID > 99999999 or :new.ID < 9999999 then
raise pkg.Illegal_update;
end if;
end;
/
Right now my trigger can only stop an illegal update if the number is too large or too small. I need a way of checking for a decimal in a number
Any suggestions are welcome thank you
What’s the DBMS? I’d declare the type of the id column to be an integer. In Oracle, you’d do it like this:
Is there some reason this is made deferrable?