Subject RE: [IBO] FW: Updating a join (in a grid)
Author jfzander@t-online.de
I am sorry I was not specific enough.

This is the query:

select
T1.id
,T1.id2
,T2.description
//This is needed for Ordering
,(select description from t2 where t1.ID =t2.ID) as Description
// That's what I meant with "select as statement" needed for TIB_LookUpCombo
FROM t1 left outer join t2 on t1.id2=t2.id

Only T1 will be updated and t2 serves as lookup table for t1.
I would love to omit the "left outer join t2 on t1.id2=t2.id" and the field
t2.description, but as I understand it, I need it for my Ordering Properties
as I can not use a Calculated field (i.e. ,(select description from t2 where
t1.ID =t2.ID) as Description) there. Now what happens if I add the left
outer join part, is, that the query is not updateable any more. However I
thought defining T1 as KeyRelation would solve that problem.

So here goes my question again:

1. Do I have to use the part "left outer join t2 on t1.id2=t2.id" for the
ordering properties or is there a way I can order on ,((select description
from t2 where t1.ID =t2.ID) as Description )?
2. Why can't I edit the respective TIB_Grid when using the above query,
shouldn't KeyRelation take care of this, as only 1 table will be updated?


Hope that was clearer.


TIA

Jan





-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Mittwoch, 6. Dezember 2000 07:43
To: IBObjects@egroups.com
Subject: Re: [IBO] FW: Updating a join (in a grid)

At 07:30 AM 06-12-00 +0100, you wrote:

>I have a TIB_Grid, showing a multiple join query. Only 1 table has to be
>edited, and all the other works as lookup tables.

This isn't clear, but... let's try to understand what you have here...

>Now I want to set the
>ordering property of TIB_Query. As it does not accept ( at least as I
>understand it) the "select as" lookup columns , I do have to add the join
>statements to the query and thus get the fields I want to order on.

Do you mean "join clauses" ? It would help if you could show us the whole
of the statement for the TIB_Query.

>However,
>when I do this, TIB_Grid will not be editable any more. I thought that was
>possible, and that KeyRelation should take care of this.

If you have a dataset based on joined tables, you need KeyRelation to say
which underlying table the UpdateSql statements apply to. But you also
have to supply the UpdateSQL statements, which you do in the EditSql,
InsertSql and DeleteSql properties.

>What is it I am doing wrong?

Show us what you are doing and we can tell you.

>Or is there a way to use Ordering with the "select as" lookup
>columns?

I can't answer this as I can't tell what you are referring to as "select
as" lookup columns.
Are we talking here about joins, or sub-selects, or calculated columns? We
need to see the SQL.

Helen

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________