I'm researching how to create a UDF to replicate a complete record of a Firebird table using triggers.
I want to create a revision/history about some tables, replicating the data to a mongodb database using a UDF to connect to the mongodb and insert the record there.
My question is: is possible to create a UDF and when I call it recognize the current table and row to get the columns values automaticly without passing the values as an argument or simply passing the OLD
and NEW
context variables?
Something like this:
CREATE TRIGGER
MY_REPLICATOR
ACTIVE AFTER INSERT OR UPDATE OR DELETE
POSITION 99
ON MY_TABLE
AS
BEGIN
/*INSIDE THE UDF IT IDENTIFIES THE CURRENT TABLE-ROW
AND REPLICATE ALL COLUMNS VALUES TO MY MONGODB*/
MY_UDF_REPLICATION(OLD, NEW);
END