Is it possible to create a foreign key from another database?

5

I want to reference a foreign key from a different bank, I have seen in some forums that it is only necessary to 'nome_database'.'nome_tabela' , but it is not working. My code is as follows:

ALTER TABLE 'relatorio_gestao'.'usuario_setores' 
ADD CONSTRAINT 'id_unidade_ifpe'
FOREIGN KEY ('id_unidade_ifpe')
REFERENCES 'bancobase'.'unidade_ifpe' ('id_unidade_IFPE')
ON DELETE NO ACTION
ON UPDATE NO ACTION;

What am I doing wrong?

    
asked by anonymous 25.04.2014 / 21:30

1 answer

1

link

In the basic documentation of Mysql does not provide this syntax database.table, I know that for example Mysql accepts check constraints but these have no effect, perhaps it is the same case.

In Oracle I implemented something like this using triggers , doing all the integrity checks through selects , but it worked.     

26.04.2014 / 03:17