Ver Mensaje Individual
  #1  
Antiguo 17-12-2004
TJose TJose is offline
Miembro
 
Registrado: may 2003
Posts: 162
Reputación: 22
TJose Va por buen camino
drop constraint

Hola a todos
Utilizo Firebird 1.5 sobre Mandrake 9.2. Tengo la siguiente tabla:

create table ordenesfacturacion (
id did /* integer 1 not null */,
fecha dfecha /* date not null */,
idcliente did /* integer 1 not null */,
importe dimporte /* numeric(9,2) 1 not null */,
empleadoadmin dnombre /* varchar(30) not null */,
fecharecepcion dfecha /* date not null */,
nrofactura dnrofactura /* varchar(13) not null */,
fechafactura dfecha /* date not null */,
importefacturado dimporte /* numeric(9,2) 1 not null */,
sector dsector /* char(1) not null */,
estadofactura destadofactura /* char(2) 1 not null default 'sp' */
);


alter table ordenesfacturacion add constraint unq_ordenesfacturacion unique (nrofactura);

alter table ordenesfacturacion add constraint pk_ordenesfacturacion primary key (id);

alter table ordenesfacturacion add constraint fk_ordenesfacturacion_01 foreign key (idcliente) references clientes (id);


y quiero eliminar unq_ordenesfacturacion con la siguiente sentencia:

alter table ordenesfacturacion drop constraint unq_ordenesfacturacion


pero no me deja, produciendose el error

This operation is not defined for system tables.
unsuccessful metadata update.
ERASE RDB$RELATION_CONSTRAINTS failed.
action cancelled by trigger (1) to preserve data integrity.
Cannot delete PRIMARY KEY being used in FOREIGN KEY definition.

Saludos
TJose
Responder Con Cita