I have a varchar2 datatype column in a table. User only can insert number to that column and I don't want to change as number. Sometimes while inserting data this column as manual, user can space in column. I create a trigger to avoid it. Trigger i wrote is as below.
CREATE OR REPLACE trigger_name
BEFORE INSERT ON table
FOR EACH ROW
BEGIN
IF :new.column != TRIM(:new.column) THEN
:new.column := TRIM(:new.column);
ELSE
dbms_output.put_line(:new.column || ' is suitable for jobid');
END IF;
END;
I got error like below while compiling above code.
"ORA-00922: missing or invalid option"
Thanks in advance.