Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLite Trigger, Convert OLD/NEW to TEXT

How to convert SQLite trigger variables OLD/NEW to TEXT or if possible a JSON object? I want to log every changes to another table.

like image 372
Kokizzu Avatar asked Feb 23 '26 20:02

Kokizzu


1 Answers

This is not possible.

OLD and NEW are not "trigger variables"; they are keywords that can be used in column references, such as OLD.columnname.

If you want to log changes of the column values, you have to write out all the columns of the table in each trigger.

like image 134
CL. Avatar answered Feb 27 '26 01:02

CL.