Subject Re: How do I test for a value before an INSERT?
Author prokhorovav
--- In ib-support@y..., Derek Basch <dbasch@y...> wrote:
> Hi,
> Im new to SQL and I have created several tables and
> would like to be able to INSERT to several of them at
> the same time. I cant seem to find any
> examples/techniques for breaking apart records and
> inserting into multiple tables.
You can create View like this:
create view all_data_from_all_tables
select t1.fields_from_table1,t2.fields_from_table2,...
from table1 t1
join table2 t2.on

and write before insert, before update and before delete triggers for
View all_data_from_all_tables
for example:

create trigger all_data_from_all_tables_bi
for all_data_from_all_tables
before insert
insert into table1(fields_from_table1)

insert into table2(fields_from_table2)

Also you can add into triggers the addition funcionality you need.

Andrey Prokhorov