Is it possible to check whether a particular value in a column exists in other databases using trigger? These two databases are located inside the same MYSQL instance. Specifically, what I want to do is this:
- Before a row is added to a table (
Document_Index_table) inside Database A (Document_DB). - A trigger is fired. This trigger carries the one of the column value (
usr_id) inside the row and pass it to Database B (User_Control_DB). - Based on the values,
User_Control_DBwill check whether theusr_idexists in columnusr_idof the table (Usr_Information). - If exists, then return a true to
Document_DBand the row in 1. is allowed to add to theDocument_DB. - If not, then an error is issued. No row is added to
Document_DB.
How can this be done, if it can be done at all?
Edit: Both databases are MySQL databases