Como criar Uma Foreign Key no Interbase

Delphi

29/02/2004

Olá Pessoal!

Gostaria de saber como posso declarar uma Foreign key no interbase.
Ex.

CREATE TABLE PROJ_FUN (

PF_ID INTEGER NOT NULL,
PF_DataEnv VARCHAR(11) NOT NULL,
PF_DataRet VARCHAR(11),
PF_DiasTrar INTEGER,

CONSTRAINT PK_PROJ_FUN PRIMARY KEY (PF_ID),

CONSTRAINT FK_FUNCIONARIOS FOREIGN KEY (FUN_ID)
REFERENCES FUNCIONARIOS (FUN_ID));


O que está errado nesta tabela?

E gostaria de saber por que o Interbase 6 não esta aceitando os tipos DATE e NUMERIC .

Sempre dá erro, ela não reconhece e eu sou obrigado a mudar para VARCHAR ai ele reconhece!

Desde já agradeço !!

Lenne

lenne1@onda.com.br


Lenne

Lenne

Curtidas 0

Melhor post

Edilcimar

Edilcimar

29/02/2004

Alter Table TabelaDependente
Add Foreign Key (NomeIndice) References TabelaRelacionada(NomeCampoChave);
Commit;


GOSTEI 1
POSTAR