How to check if constraint exists before adding
Posted: 10.08.2008, 14:50
Hi, I'm using Zeos and Firebird.
I create a table with a constraint e.g.
'ALTER TABLE Table1 ADD CONSTRAINT FK_TEST1 FOREIGN KEY (Field1) REFERENCES Table2(Field2)'
When I run the program again, the constraint already exists so I get an error. How can I change the statement to avoid the error please? (I'm rather new to all this)
Many thanks
Kerin
I create a table with a constraint e.g.
'ALTER TABLE Table1 ADD CONSTRAINT FK_TEST1 FOREIGN KEY (Field1) REFERENCES Table2(Field2)'
When I run the program again, the constraint already exists so I get an error. How can I change the statement to avoid the error please? (I'm rather new to all this)
Many thanks
Kerin