Triggers to copy information I have 2 Tables.

Bank (Original Table):

ID
Bank_Code
Bank_Transaction
Delete


Bank_History:

ID
Bank_ID
CodeH
TransactionH


I need for the Bank table to copy into Bank_History using triggers. Here is what I have so far:

CREATE TRIGGER `Bank_after_update` AFTER UPDATE ON `Bank`
 FOR EACH ROW BEGIN 

    IF NEW.Deleted THEN
        SET @Change_Type = 'DELETE';
    ELSE
        SET @Change_Type = 'EDIT';
END IF;
INSERT INTO Bank_History (bank_id, Change_type) VALUES (NEW.id, @Change_Type); 
END


It creates a new record but it doesn't transfer all the info.
When you say, "it doesn't transfer all the info" what exactly do you mean? Do you want to insert into the history table before the data is updated AND after for auditing purposes?


  ...the mysql statement delimiter so that you can use the ; statement
  delimiter within the trigger definition.


Check the MySQL trigger reference section at MySQL for more info.

Either way, try adding he DELIMITER // at the beginning and the end.

DELIMITER //
CREATE TRIGGER `Bank_after_update` AFTER UPDATE ON `Bank`
 FOR EACH ROW BEGIN 

    IF NEW.Deleted THEN
        SET @Change_Type = 'DELETE';
    ELSE
        SET @Change_Type = 'EDIT';
END IF;
INSERT INTO Bank_History (bank_id, Change_type) VALUES (NEW.id, @Change_Type); 
END
//


I hope this helps.