Subject | Re: [ib-support] Re: Constraints |
---|---|
Author | Ann W. Harrison |
Post date | 2001-06-20T14:30:48Z |
Let me offer the abstract of a solution combining several
ideas - mostly Diane's.
The Paradox tables look like this:
create table Codes (code integer not null primary key,
string varchar (50));
create table Orders (order integer not null primary key,
order_type integer
other stuff);
The InterBase tables look like this:
create table Codes (code integer not null primary key,
string varchar (50));
create table Orders (order integer not null primary key,
order_type integer
other stuff
questionable_row integer); <-------------
The trigger on orders looks like this:
create trigger order_bi1 for orders before insert
position 1
as begin
if new.questionable_row = 0
then if not exists (select 1 from codes
where code = new.order_type)
then <error>
end;
Store all your current rows with "questionable_row" = 1. As
you clean them up, change the value to 0.
Regards,
Ann
www.ibphoenix.com
We have answers.
ideas - mostly Diane's.
The Paradox tables look like this:
create table Codes (code integer not null primary key,
string varchar (50));
create table Orders (order integer not null primary key,
order_type integer
other stuff);
The InterBase tables look like this:
create table Codes (code integer not null primary key,
string varchar (50));
create table Orders (order integer not null primary key,
order_type integer
other stuff
questionable_row integer); <-------------
The trigger on orders looks like this:
create trigger order_bi1 for orders before insert
position 1
as begin
if new.questionable_row = 0
then if not exists (select 1 from codes
where code = new.order_type)
then <error>
end;
Store all your current rows with "questionable_row" = 1. As
you clean them up, change the value to 0.
Regards,
Ann
www.ibphoenix.com
We have answers.