Home > database >  The Oracle database import data validation
The Oracle database import data validation

Time:09-23

insert data in the Oracle database can validate data, such as: for the length of the id card, whether the Numbers or letters for validation,

CodePudding user response:

Can, in either process or trigger

CodePudding 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 constraint

CodePudding user response:

A simple calibration and check

CodePudding user response:

With a trigger
Your best bet is on the front end use JS to solve

CodePudding user response:

reference 5 floor sych888 reply:

use triggersYour best bet is on the front end use JS to solve

Because someone around the front desk, using tools directly to import the data in the front page is useless

CodePudding user response:

Trigger after check out the rules of data can not be put in storage?

CodePudding user response:

Need dynamic SQL stored procedures
  • Related