CodePudding user response:
Can, in either process or triggerCodePudding user response:
The create or replace the trigger tri_val_info
Before the insert on tablename
For each row
Declare
Num int.
Myexp exception;
The begin
Select count (*) into num from score where columnname. Length<> 18;
If num> 0 then
Raise myexp;
end if;
The exception
The when myexp then raise_application_error (' 20002 ', 'id length is wrong, can't insert. ');
end;
CodePudding user response:
Or in the field with a layer of the check constraintCodePudding user response:
A simple calibration and checkCodePudding user response:
With a triggerYour best bet is on the front end use JS to solve
CodePudding user response: