I'd like to create a trigger to export to csv the new data added to the table. I've written:
this exports the new data once for every record in the table, so I got a csv with the new account_code 361 times.
I also really wanted to export all of the data, so have tried select new.* but nothing exported at all.
Any help would be appreciated.
Code:
delimiter | create trigger trg_customer_csv after insert on customers for each row begin select new.account_code into outfile 'e:/trigfile.csv' fields terminated by ';' lines terminated by '\n' from customers; end; |
I also really wanted to export all of the data, so have tried select new.* but nothing exported at all.
Any help would be appreciated.
Comment