Skip to Main Content
  • Questions
  • Debuging triggers referencing new as new old as old values


Dev Live Dev Intro

We are celebrating Developers at AskTOM. We welcome Developers of all levels of experience to join us at our FREE Developer Live events coming in August and September. Just click on the left to register today! If you are brand new to Database Technology, then we also have got you covered. Just click on the right for your comprehensive FREE training program to kick start your Oracle Database Development journey!

Question and Answer

Chris Saxon

Thanks for the question, RAFAEL.

Asked: July 13, 2020 - 3:19 pm UTC

Answered by: Chris Saxon - Last updated: July 14, 2020 - 2:48 pm UTC

Category: PL/SQL - Version: 11.2.0

Viewed 100+ times

You Asked

I'm wondering if there is a way to see in debug mode, the values that belong to the :new and :old trigger variables in Oracle.

and we said...

I'd recommend installing/creating a logging framework that allows you to set the logging level (debug/info/warning/error/...), then stores all higher priority to a database table.

For example, logger:

Then call this in your trigger body, recording all the old/new values of interest. e.g.:

  logger.log ('Old values ' || :old.c1 || ', ' || :old.c2 ... );
  logger.log ('New values ' || :new.c1 || ', ' || :new.c2 ... );
  ... trigger processing ...

More to Explore


Check out more PL/SQL tutorials on our LiveSQL tool.