0
Hello, I need to know how to create a trigger
in the Oracle database for you to monitor a insert
or update
in an NCM field of a product so that it is not less than 8 characters, follows example below:
IF LENGTH(UPDATING ('NCM') OR INSERTING)
AND (:NEW.NCM < 8)
THEN
RAISE_APPLICATION_ERROR (-20101,'Campo NCM deve possui 8 caracteres.');
What is the name of your table?
– Guilherme Martin
The table name is TGFPRO
– Fernando Gonçalves
Do by check Constraint https://stackoverflow.com/questions/32156650/minimum-length-constraint-on-a-column
– Motta