Please tell me how to get the data, not the names of the columns. I do the before - update trigger, which saves changes from the main table to the shadow table - it looks like this

INSERT INTO s_sys (time_edit, guid, edit_string) VALUES (old.time_edit, old.guid, ( SELECT CONCAT('old.', ( SELECT GROUP_CONCAT(COLUMN_NAME SEPARATOR ', old.') FROM information_schema.columns WHERE TABLE_NAME = 'sys' ) ) ) ); 

Please help get the data fields and not their headers

  • A request from INFORMATION_SCHEMA should collect not just a list of field names, but the text of a request for getting values. Then this query is executed through the prepared statement, and its result is written to the log table. - Akina
  • Please describe in more detail - I swear at PREPARE, they say they say dynamic cheekbones ,. I tried to run the procedure through a call in the same trigger - rau.dmitry
  • Did not pay attention that this is a trigger. But if so, then it operates with data of a certain table, the structure of which is known - what for, it is asked, to go in INFORMATION_SCHEMA? - Akina
  • Well I will describe the task differently there are two tables - combat (say sys) and shadow (say s_sys) while the number of fields (like their names) in combat is unknown but no less than 5, and the number of fields in shadow is always 3 how to organize the trigger for logging write the shadow table. Let's say if it is implemented in a firebird so this is just a song, in MySQL there are solid tears - rau.dmitry
  • the number of fields (as well as their names) in combat is unknown. Here is this phrase completely incomprehensible to me. You're doing a trigger on this table - who's stopping to see the structure? - Akina

0