Help with TQL Join

29 views
Skip to first unread message

Robert Rawlins

unread,
Oct 11, 2011, 7:07:46 AM10/11/11
to transf...@googlegroups.com
Hello Guys,

I have the following TQL query, which runs as expected:

    <cfsavecontent variable="LOCAL.TQL">
        from inventory.Stock As Stock
        join order.item As Item
        where Stock.StockNumber = :StockNumber
    </cfsavecontent>

Now, I want to create an additional join, this time from the Item object to the 'Order' object. This relationship is defined in transfer as a OneToMany from the Order to the Item.

I see details in the docs on how to do multiple joins from the Stock object, however, not how to do an extended join like.

Stock -> Item -> Order

So that I can collect a list of stock that is associated to a particular order through the given line item.

Can anyone offer any advice on this?

Robert

Stephen Moretti

unread,
Oct 12, 2011, 4:33:57 PM10/12/11
to transf...@googlegroups.com
Robert,
 
I'm not sure what the problem is.  TQL isn't that different from SQL.  

Create your joins manually and specify the properties you need from each of the objects pretty much the same way you would with standard SQL.

Is there something unexpected happening?

Stephen 

--
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
 
Try out the new Transfer ORM Custom Google Search:
http://www.google.com/cse/home?cx=002375903941309441958:2s7wbd5ocb8
 
You received this message because you are subscribed to the Google Groups "transfer-dev" group.
To post to this group, send email to transf...@googlegroups.com
To unsubscribe from this group, send email to transfer-dev...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/transfer-dev?hl=en



--
Stephen Moretti
Blog : http://nil.checksite.co.uk/
Twitter : http://twitter.com/mr_nil

Pedro Bezunartea López

unread,
Oct 20, 2011, 11:23:42 AM10/20/11
to transf...@googlegroups.com

Hi Robert,

If the relations are already defined in transfer's config file, you could just join them as you have done already:

TQL = "FROM inventory.Stock AS Stock JOIN order.item AS Item JOIN order.order AS Order WHERE Stock.StockNumber= :StockNumber"

From my experience, if there's only one possible relation that fits the JOIN, it'll be used. Have you tried this? What happened?

Cheers,

Pedro.
Reply all
Reply to author
Forward
0 new messages