Ver Mensaje Individual
  #1  
Antiguo 25-07-2008
franfl franfl is offline
Miembro
 
Registrado: feb 2008
Posts: 88
Reputación: 17
franfl Va por buen camino
On Delete Set Default

Hola
Tengo dos tablas: CLIENTE q tiene una foreign key a PROGRAMA, entonces necesito hacer q al borrar un programa, en CLIENTE me guarde un 0, q es un programa q nunca lo puedo modificar ni borrar. Entonces no se como declararlo, vi que se hace con un set default pero me da error al crearla.

ALTER TABLE CLIENTE
add constraint IDPROGRAMA
FOREIGN KEY(IDPROGRAMA) REFERENCES PROGRAMA(IDPROGRAMA) ON DELETE SET DEFAULT 0 ON UPDATE CASCADE

Ah uso INTERBASE
A ver si alguien me puede ayudar
Muchas gracias
Responder Con Cita