Subject Re: Inserting into detail table of Master/Detail
Author Rick Roen
Rade,

I tried the revised query with the sub-selects, but it does not work
either. I already had the KeyRelation table set.

I must be missing something basic, but I just can't figure out what
it is.

For now, I just took over the insert in the before post event and am
doing a custom insert via a TIB_Cursor.

Thanks for your help.

Rick

--- In IBObjects@yahoogroups.com, "radevojvodic" <rvojvodic@r...>
wrote:
>
> You can try 2 different approaches:
>
> First, if your sql looks like you wrote then possible solution
coul be
> to put KeyRelation parameter in query editor (it should be the
name of
> table that you trying to insert to)
>
> Second, You could rewrite your query to something like this
>
> SELECT S.IDNUM
> , S.MIXNUM
> , (Select B1.NAME From BULK_SEED B1
> Where B1.ITEMNUM = S.MIXNUM) AS MIX_NAME
> , S.SEEDNUM
> , (Select B2.NAME From BULK_SEED B2
> Where B2.ITEMNUM = S.MIXNUM) AS SEED_NAME
> , S.MIX_PERCENT
> , S.COLOR
> FROM SEED_MIXTURES S
>
> and it should be OK.