Subject Re: [firebird-support] Problem when creating FK
Author Leonardo Carneiro
Hi Svein,

Tks very much for your quick answer. Indeed, the statement did return one
row. Instead of adding it to POSICOES, i removed it from
EXCESSOS_VELOCIDADE. After this i was able to create the FK.

Again, thank you very much for your help.

2012/1/26 Svein Erling Tysvær <svein.erling.tysvaer@...>

> Does this statement return any rows?
>
> SELECT EV.POSICAO_ID_FINAL
> FROM EXCESSOS_VELOCIDADE EV
> WHERE NOT EXISTS(SELECT * FROM POSICOES P WHERE P.COMUNICACAO_ID =
> EV.POSICAO_ID_FINAL)
>
> If so, that value must be added to POSICOES before you can create your
> foreign key.
>
> HTH,
> Set
>


[Non-text portions of this message have been removed]