The mi_trigger_get_old_row() function

The mi_trigger_get_old_row() function returns the name of the old row value if the MI_TRIGGER_FOREACH_EVENT bit is set, which implies that the MI_TRIGGER_BEFORE_EVENT or the MI_TRIGGER_AFTER_EVENT bits are not set. In addition, mi_trigger_get_old_row() returns all the columns in the requested row, not just those columns into which data was explicitly inserted. Columns with default data are also returned.

Syntax

MI_ROW *mi_trigger_get_old_row(void)
Valid in client LIBMI application? Valid in user-defined routine?
No Yes

Usage

For a DELETE or UPDATE statement, the mi_trigger_get_old_row() function returns the row that was deleted or the value of the row before it was updated. It returns NULL when called in other trigger action statements. This function can be called in SPL trigger functions and trigger procedures only within the triggered action list of the FOR EACH ROW clause in trigger definitions.

Return values

An MI_ROW pointer
A pointer to the old row.
NULL
The function was one of the following:
  • not successful.
  • not in the trigger action.
  • not in the FOR EACH row trigger.
  • not in one of the DELETE or UPDATE triggers.