From what I can determine, determining that: NEW and: OLD is really a bit vague. I saw this referred to as a pseudo-entry reference. It would seem that instead of the actual rowtype with each column referenced within the rowtype, Oracle sets up a link to each individual column that you then reference using: NEW and: OLD. But as you will find out: NEW and: OLD, it seems, cannot be used on their own.
For example, here . (yes, I know this is a Java link, but see the comment on: OLD is not a valid link on its own.
I also found this block of notes SYS.DBMS_DEBUG , which implies that: NEW /: OLD is also not a valid binding.
- get_value and set_value now support binding names. Name binding should be - put in quotation marks and uppercase. Note that trigger bindings have - qualified names, i.e. ": NEW" is not a valid binding, but ": NEW.CLMN" is indeed.
Was this suggestion of using the AFTER trigger for you? From your example, it looks like there are no checks on the values ββ(realizing that you may not have used this in your example for simplicity).
I tried to imagine a way to create a public type "on the fly" (within your trigger) that matches your table row type using the all_tab_columns view, and then pasted all the values ββinto it, but couldn't completely wrap my head around the details about how it can slip out ... if it even works. And that probably ends up requiring more work than is required to record a historical record!
source share