4

Is it possible to access ORA_ROWSCN pseudo-column in the body of BEFORE triggers? I'm thinking about storing this value in the table itself to emulate SQLServer rowversion behaviour.

4
  • Thanks for contributing your answer :-) incidentally, why can't you just use ora_rowscn - why do you need to store it again in the table? Dec 22, 2011 at 20:47
  • @ Jack Douglas: I tried to store ora_rowscn in the table as a separate column (similar to how SQLServer's rowversionworks, so I don't need to change queries that use this feature while migrating from one RDMS to another).
    – a1ex07
    Dec 22, 2011 at 20:52
  • I understand. You know about rowdependencies of course? Dec 22, 2011 at 21:34
  • Yeah, I know that to have a row version, not a block version , table should be created with rowdependencies
    – a1ex07
    Dec 22, 2011 at 22:20

1 Answer 1

1

It doesn't seem to be possible (even if Oracle itself populates the value before launching BEFORE UPDATE trigger) - referring to :NEW.ora_rowscn in the trigger body generates error, select ora_rowscn from table1 in the trigger causes mutating trigger error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.