When creating a row-wise trigger in SAP HANA, a reference to a Row type variable can be obtained. E.g. in the example below :new_row
and :old_row
are row type variables.
create trigger test_trigger
after insert on test_table
referencing new row new_row, old row old_row
for each row
begin
I am attempting to serialize or convert the Row type variable values to a string or binary type of object. I have not been able to find a way of doing this directly. I.e.
INSERT INTO result_table(row_data) VALUES (<somehow serialize :new_row>);
As an alternative, I could iterate over the column values in the row (:new_row
) and convert each of them into a string/binary value in turn, but I couldn't find a way of doing this either.
Note, this has to happen inside the trigger, and as such, Dynamic SQL is not an option as it is not support inside a trigger with SAP HANA.
Is this possible at all?