Subject | Re: Updateable Views question. |
---|---|
Author | mikcaau |
Post date | 2005-01-19T02:56:11Z |
--- In firebird-support@yahoogroups.com, "Greg At ACD"
<GregAtACD@h...> wrote:
<from MyTable> <from MySubTable>
col1, col2 col1, col2, col3
MyTable will be duplicated in every row of the view.
Where MyTable has no child records in MySubTable there will be nulls
in the columns View.MySubTable.
As a result in MyView.BeforeUpdate trigger you can test for null in a
Not Null field and perform an insert if necessary.
Primary Key field is a good one.
mick
<GregAtACD@h...> wrote:
>snip
> I have 2 tables (MyTable, MySubTable) where MySubTable's primary key
> is also a foreign key to MyTable. So, MySubTable is truly a child of
> MyTable.
>
> Does anyone have any ideas how to best implement this type ofYour view will look like this
> scenario? Is it best to abandon the idea of an updateable trigger
> for this situation?
>
> thx!
>
> Greg
<from MyTable> <from MySubTable>
col1, col2 col1, col2, col3
MyTable will be duplicated in every row of the view.
Where MyTable has no child records in MySubTable there will be nulls
in the columns View.MySubTable.
As a result in MyView.BeforeUpdate trigger you can test for null in a
Not Null field and perform an insert if necessary.
Primary Key field is a good one.
mick