Hi Paul,
I send the C UDR and a working.sql and a notworking.sql scripts.
You will see in the DEBUG* files the tracing.
What I need to do, is a generic UDR that take the old/new row and return a lvarchar containing a json of the data excluding TEXT, BYTE, BLOB, CLOB, row, collection, list, ... and limiting lvarchar column to the first 255 characters.
After that I can cast it in json and bson to keep a log of change in important tables in a generic log tables.
So the working.sql call row_to_json directly from the trigger and pass the value to a SPL procedure with trigger references.
The notworking.sql call the row_to_json from the SPL procedure with triggers references.
Thanks for your help.
Jean-Guy Charron Président Logiciels Sys-Thèmes inc. | | | | | |
|
|
|
|
Original Message:
Sent: 9/3/2025 7:05:00 PM
From: Paul Watson
Subject: RE: C UDR using mi_trigger_get_old_row() and mi_trigger_get_new_row()
A real NULl or just crap ?
Cheers
Paul
Paul Watson
Oninit LLC
+1-913-387-7529
www.oninit.com
Oninit®️ is a registered trademark of Oninit LLC
Original Message:
Sent: 9/3/2025 5:27:00 PM
From: Jean-Guy Charron
Subject: RE: C UDR using mi_trigger_get_old_row() and mi_trigger_get_new_row()
Yes I effectivly received a NULL.
But since I call the UDR from an SPL with trigger references I expected to received the old/new row.
I just hoped there was a solution.
Thanks for your help
------------------------------
Jean-Guy Charron
------------------------------
Original Message:
Sent: Wed September 03, 2025 05:17 PM
From: Paul Watson
Subject: C UDR using mi_trigger_get_old_row() and mi_trigger_get_new_row()
I suspect you are getting a NULL rather that a valid row ptr, I believe it will be NULL cos you are in a SPL
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.
On 9/3/2025 3:27 PM, Jean-Guy Charron via IBM TechXchange Community wrote:
01000199114329d4-a23cc2f6-599d-415a-9251-a193c02f6858-000000@email.amazonses.com"> Hi Everyone, I have create a C UDR row_to_json that use mi_trigger_get_old_row() and mi_trigger_get_new_row() to have access to the trigger row... -posted to the "Informix" group