trigger for creating a csv file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nilotpal sarkar
    New Member
    • Feb 2012
    • 2

    trigger for creating a csv file

    i am new in triggers.
    i want a trigger that would fire when i insert rows in table and would create a csv file of the datas in the table.
    is it possible in mysql?
    i wrote:


    create trigger trg_af_ins_test 1 after insert on test1
    begin
    select * into outfile 'trigfile.csv'
    fields terminated by '\t'
    lines terminated by '\n'
    from emp;
    end;

    please help.
    thanx in advance.
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    change the line "FROM EMP;" to "FROM test1"...

    Comment

    Working...