Re: [gnome-db] GdaSqlSelectJoin



On 2 March 2010 22:02, Piotr Pokora <piotrek pokora gmail com> wrote:
> Vivien Malerba pisze:
>
> Hi!
>
>> Yes, the GdaSqlSelectJoin's structure is valid (I mean no wild pointers, ...)
>>
>> However this would translate as
>> ... FROM ... LEFT JOIN ... ON (style) USING (t1.style, style.id)
>> which is not what you want: you need to either define the USING part
>> or the ON part, more likely in your case:
>> ... ON (t1.style=style.id)
>>
>> So the "style" has to be defined as a GdaSqlSelectTarget and the
>
> Should I add table_name to GdaSqlSelectTarget and this one append to
> targets? It creates 'FROM tbl1, tbl2' which is not valid for JOIN.

You need to create a GdaSqlSelectTarget for each table (or other)
involved after a FROM, and a GdaSqlSelectJoin for each pair of joined
targets. So here for example you need 2 targets and 1 join. The
join->position attribute indicates that
the join is in fact joinning a target which position is < to
join->position, and the target at join->position (the target's
position is the position of the GdaSQlSelectTarget in the
from->targets).

>
>> join->on has to point to a GdaSqlExpr representing the
>
> Hmmm... What is 'join->on' ?

Sorry, I meant join->expr.

>
>> "t1.style=style.id" condition (the same construct as for the WHERE
>> clause applies here), and join->use = NULL.
>
> OK. Thanks for 'join->use' tip!

Vivien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]