Fórum Como criar Uma Foreign Key no Interbase #217264
29/02/2004
0
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
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
Curtir tópico
+ 0
Responder
Post mais votado
29/02/2004
Alter Table TabelaDependente
Add Foreign Key (NomeIndice) References TabelaRelacionada(NomeCampoChave);
Commit;
Add Foreign Key (NomeIndice) References TabelaRelacionada(NomeCampoChave);
Commit;
Edilcimar
Responder
Gostei + 1
Clique aqui para fazer login e interagir na Comunidade :)