I need to develop a trigger in PL/SQL (Oracle) before INSERT.
In this table there is a column (cdat) of type DATE.
Let’s say i do INSERT INTO myTbl (123,'12/05/2011');
In my trigger the :NEW.CDAT is converted in the final date system or it’s still a varchar?
Do I need to do a TO_DATE(:NEW.CDAT) to get the date value?
:NEW.CDATwill be a date. The:newand:oldvariables in triggers are always the type of the destination field.I wasn’t able to find anything in the Oracle documentation that confirms my statement, but I was able to devise some experimental proof:
Since type_test is overloaded, Oracle will choose which procedure to use based on the type being passed in. The results of this script are: