Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

Mengubah pemicu Oracle menjadi Pemicu MySql

MySQL tidak menggunakan titik dua, dan ada beberapa variasi kecil lainnya. Saya pikir ini akan berhasil:

DELIMITER $$

CREATE OR REPLACE TRIGGER PRE_DEL_LN_CLIENTS
BEFORE DELETE ON LN_CLIENTS
FOR EACH ROW
BEGIN
  INSERT INTO LN_CLIENTS_DELETED (REC_ID, LOAN_NUMBER, CLIENT_SEQ_NUM, FIRST_NAME, FATHER_NAME, FAMILY_NAME, MOTHER_NAME, NATIONALITY, SEX, BIRTH_PLACE_CODE, BIRTH_PLACE_TEXT, BIRTH_DATE, REG_PLACE_CODE, REG_PLACE_TEXT, REG_NUM, ADDRESS_CODE, ADDRESS_TEXT, PHONE, EDUCATION_LEVEL_CODE, PROFESSION_CODE, PROFESSION_TEXT, MONTHLY_INCOME, WORK_PLACE, WORK_ADDRESS_TEXT, ID_DOC_TYPE, ID_DOC_NUM1, ID_DOC_NUM2, ID_DOC_DATE, NOTES, OFFICE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, SYNC_FLAG)
      VALUES(OLD.REC_ID, OLD.LOAN_NUMBER, OLD.CLIENT_SEQ_NUM, OLD.FIRST_NAME, OLD.FATHER_NAME, OLD.FAMILY_NAME, OLD.MOTHER_NAME, OLD.NATIONALITY, OLD.SEX, OLD.BIRTH_PLACE_CODE, OLD.BIRTH_PLACE_TEXT, OLD.BIRTH_DATE, OLD.REG_PLACE_CODE, OLD.REG_PLACE_TEXT, OLD.REG_NUM, OLD.ADDRESS_CODE, OLD.ADDRESS_TEXT, OLD.PHONE, OLD.EDUCATION_LEVEL_CODE, OLD.PROFESSION_CODE, OLD.PROFESSION_TEXT, OLD.MONTHLY_INCOME, OLD.WORK_PLACE, OLD.WORK_ADDRESS_TEXT, OLD.ID_DOC_TYPE, OLD.ID_DOC_NUM1, OLD.ID_DOC_NUM2, OLD.ID_DOC_DATE, OLD.NOTES, OLD.OFFICE, OLD.CREATED_BY, OLD.CREATED_ON, OLD.UPDATED_BY, OLD.UPDATED_ON, 'I');
END$$

DELIMITER ;



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Pernyataan MySQL SIAPKAN dalam prosedur tersimpan

  2. DO dan DONT untuk Indeks

  3. MySQL WHERE Tanggal> 15 Hari

  4. Mengapa kueri tidak diperbarui setelah mengklik tombol perbarui?

  5. Tidak bisa mendapatkan pengkodean dengan benar di MySQL