CREATE ALGORITHM = UNDEFINED DEFINER = `aerion`@`localhost` SQL SECURITY DEFINER VIEW `aerion`.`vw_temp_1` AS SELECT `inv_to_ref_table`.`inv_to_ref_id` AS `consult_id`, _UTF8'inv' AS `Table_name`, _UTF8'inv_to_ref_id' AS `refid`, _UTF8'inv_to_ref_table' AS `reftable`, _UTF8'' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`inv` `inv_to_ref_table` WHERE (`inv_to_ref_table`.`inv_to_ref_table` = _LATIN1'Consultant') UNION SELECT `assist_ref_table`.`assist_ref_id` AS `assist_ref_id`, _UTF8'prosp_assist' AS `Table_name`, _UTF8'assist_ref_id' AS `refid`, _UTF8'assist_ref_table' AS `reftable`, _UTF8'prosp_assist' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`prosp_assist` `assist_ref_table` WHERE (`assist_ref_table`.`assist_ref_table` = _LATIN1'Consultant') UNION SELECT `aerion`.`immi_hierarchy`.`immi_hierar_ref_id` AS `immi_hierar_ref_id`, _UTF8'immi_hierarchy' AS `Table_name`, _UTF8'immi_hierar_ref_id' AS `refid`, _UTF8'immi_hierar_table' AS `reftable`, _UTF8'immi_hierarchy' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`immi_hierarchy` WHERE (`aerion`.`immi_hierarchy`.`immi_hierar_table` = _LATIN1'Prosp Consultant') UNION SELECT `aerion`.`immi_emp_receipt`.`immi_ref_id` AS `immi_ref_id`, _UTF8'immi_emp_receipt' AS `Table_name`, _UTF8'immi_ref_id' AS `refid`, _UTF8'immi_ref_table' AS `reftable`, _UTF8'immi_emp_receipt' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`immi_emp_receipt` WHERE (`aerion`.`immi_emp_receipt`.`immi_ref_table` = _LATIN1'Consultant') UNION SELECT `aerion`.`bank_acc`.`acc_owner` AS `acc_owner`, _UTF8'bank_acc' AS `Table_name`, _UTF8'acc_owner' AS `refid`, _UTF8'acc_owner_table' AS `reftable`, _UTF8'acc_owner_table' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`bank_acc` WHERE (`aerion`.`bank_acc`.`acc_owner_table` = _LATIN1'Consultant') UNION SELECT `aerion`.`storages`.`updated_for_ref_id` AS `updated_for_ref_id`, _UTF8'storages' AS `Table_name`, _UTF8'updated_for_ref_id' AS `refid`, _UTF8'updated_for_ref_table' AS `reftable`, _UTF8'storages' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`storages` WHERE (`aerion`.`storages`.`updated_for_ref_table` = _LATIN1'Consultant') UNION SELECT `aerion`.`prosp_refund1`.`ref_for_id` AS `ref_for_id`, _UTF8'prosp_refund1' AS `Table_name`, _UTF8'ref_for_id' AS `refid`, _UTF8'ref_for_table' AS `reftable`, _UTF8'prosp_refund1' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`prosp_refund1` WHERE (`aerion`.`prosp_refund1`.`ref_for_table` = _LATIN1'Consultant') UNION SELECT `aerion`.`prosp_refund_detail`.`ref_for_id` AS `ref_for_id`, _UTF8'prosp_refund_detail' AS `Table_name`, _UTF8'ref_for_id' AS `refid`, _UTF8'ref_for_table' AS `reftable`, _UTF8'prosp_refund_detail' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`prosp_refund_detail` WHERE (`aerion`.`prosp_refund_detail`.`ref_for_table` = _LATIN1'Consultant') UNION SELECT `aerion`.`prosp_activity`.`prosp_consult_id` AS `prosp_consult_id`, _UTF8'prosp_activity' AS `Table_name`, _UTF8'prosp_consult_id' AS `refid`, _UTF8'' AS `reftable`, _UTF8'prosp_activity' AS `tbl_to_update`, _UTF8'emp_activity' AS `tbl_to_insert` FROM `aerion`.`prosp_activity` UNION SELECT `aerion`.`prosp_attach`.`prosp_consult_id` AS `prosp_consult_id`, _UTF8'prosp_attach' AS `Table_name`, _UTF8'prosp_consult_id' AS `refid`, _UTF8'' AS `reftable`, _UTF8'prosp_attach' AS `tbl_to_update`, _UTF8'emp_attach' AS `tbl_to_insert` FROM `aerion`.`prosp_attach` UNION SELECT `aerion`.`prosp_contact`.`prosp_consult_id` AS `prosp_consult_id`, _UTF8'prosp_contact' AS `Table_name`, _UTF8'prosp_consult_id' AS `refid`, _UTF8'' AS `reftable`, _UTF8'prosp_contact' AS `tbl_to_update`, _UTF8'emp_contact' AS `tbl_to_insert` FROM `aerion`.`prosp_contact` UNION SELECT `aerion`.`prosp_tag`.`prosp_consult_id` AS `prosp_consult_id`, _UTF8'prosp_tag' AS `Table_name`, _UTF8'prosp_consult_id' AS `refid`, _UTF8'' AS `reftable`, _UTF8'prosp_tag' AS `tbl_to_update`, _UTF8'emp_tag' AS `tbl_to_insert` FROM `aerion`.`prosp_tag` UNION SELECT `aerion`.`prosp_consult`.`prosp_consult_id` AS `prosp_consult_id`, _UTF8'prosp_consult' AS `Table_name`, _UTF8'prosp_consult_id' AS `refid`, _UTF8'' AS `reftable`, _UTF8'prosp_consult' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`prosp_consult` UNION SELECT `aerion`.`test_cnv`.`cnv_ref_id` AS `cnv_ref_id`, _UTF8'test_cnv' AS `Table_name`, _UTF8'cnv_ref_id' AS `refid`, _UTF8'cnv_ref_table' AS `reftable`, _UTF8'test_cnv' AS `tbl_to_update`, _UTF8'' AS `tbl_to_insert` FROM `aerion`.`test_cnv` WHERE (`aerion`.`test_cnv`.`cnv_ref_table` = _LATIN1'Consultant')