On Tue, Sep 27, 2016 at 1:10 PM, Igor Neyman <iney...@perceptron.com> wrote:
> > > Patrick, > > > > You need to explain your problems in more “coherent” way, David suggested > one. > > If you aren’t willing, people will stop responding to your request, they > are not obligated to read your mind. > > > I'll put it this way - the only conclusion I can draw in reading the provided code is that the data model is screwed up and may not be capable of accommodating this goal. Albeit this is based upon a incompletely specified model... If you want table1 and table2 to have a 1-to-1 relationship then the assignment of the unique key should not occur via next_val() calls in the default expression of either table. When you query "not_monthly" you need to figure out what the new ID should be and explicitly add it to both INSERT statements. David J.