Subject Drop primary key constraint with no name
Author val_melamed
Hi all,

I need to drop the primary key constraint on a table which was
created something like this:

CREATE TABLE NameValue (
Name VARCHAR(100) NOT NULL,
Value VARCHAR(100)
);
ALTER TABLE NameValue ADD PRIMARY KEY (Name);

I.e. the constraint does not have name. What is the best way to drop
the constraint in a script? From reading a similar question in this
group it looks like

delete from
RDB$RELATION_CONSTRAINTS
where
RDB$CONSTRAINT_TYPE='PRIMARY KEY' and
RDB$RELATION_NAME='NameValue'

should do the trick. Can someone please confirm this as a number of
our customers will be affected.

Thanks in advance.
Val Melamed