JoshWegener
asked on
How do I create a Constraint in FireBird
I am writing a progam that converts MySQL database into a FireBird database... what is the SQL code (isql) to create a Constraint on a table?
ASKER
I need a FK Constraint
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CREATE TRIGGER ARTWORK_I FOR ARTWORK
ACTIVE BEFORE INSERT POSITION 0
AS
begin
IF ((new.artwork_u is NULL) OR (new.artwork_u < 1)) THEN
new.artwork_u = gen_id(gen_artwork, 1);
end
a constraint is on a field in the table
CREATE TABLE ARTWORK (
ARTWORK_U INTEGER NOT NULL,
DATE_SUBMITTED TIMESTAMP NOT NULL,
DATE_RETURNED TIMESTAMP,
CONSTRAINT ARTWORK_PK PRIMARY KEY (ARTWORK_U)
);