I'm having issues with non ASCII characters getting into my database due to user input.
I want to create a trigger on the database so when a specific character is inserted/updated it just replaces it with a blank space.
This is my trigger (I will add multiple characters that are not allowed) :
CREATE OR REPLACE TRIGGER database.incidents_ascci_summary
BEFORE INSERT OR UPDATE ON database.table
FOR EACH ROW
BEGIN
if :new.column like '%'||chr(253)||'%' then
:new.column := REPLACE( :new.column, ''%'||chr(253)||'%'', ' ' );
END if;
END;
/
chr(253) = ý
Which creates the trigger. However, when I run
UPDATE table f
SET f.column = 'Hiýa'
WHERE f.incidentid = 'INCIDENT#'
I get this error message from Oracle:
ORA-04098: trigger 'INCMAN.INCIDENTS_ASCCI_SUMMARY' is invalid and failed re-validation
Any help would be greatly appreciated!