Subject | Re: [firebird-support] Problem when creating FK |
---|---|
Author | Leonardo Carneiro |
Post date | 2012-01-26T15:07:12Z |
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@...>
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?[Non-text portions of this message have been removed]
>
> 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
>