Jos&#233&#59; Regal.

There is a tipical and simple situation using SQL but here I am usin CAML

The scene is three cascade lists as country, region, city linked by lookup fields and I need to obtain the cities of certain country , something like :

select city.*

from city inner join region on city.idregion = region.id inner join country on region.idcountry = country.id

where country.id = 'X'

u know, but the problem with CAML is that I don`t know how to load cities by querying the countries, joining or whatever

Looking for in the MSDN I found a little reference for SPQuery CAML but doesn't say nothing about

Thx before all, Jose.




Re: SharePoint - Workflow CAML query and joins

George Olson

Hello,

I am not quite sure what you are asking, but there is a great query tool that shows different queries. Just make sure to change the app.config to use the appropriate server. http://www.gotdotnet.com/Community/UserSamples/Details.aspx SampleGuid=89b3cda7-aad9-4919-8faf-34ef9b28c57b.





Re: SharePoint - Workflow CAML query and joins

José Regal.

I downloaded but It doesn't work, unexpected error or somethig like that Sad

More ideas






Re: SharePoint - Workflow CAML query and joins

George Olson

Hello Jose,

I have looked into it and the tool I talked about does not have joins. I found another CAML query tool on U2U, but it doesn't deal with joins either. You may still want to check it out: http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx ID=1252





Re: SharePoint - Workflow CAML query and joins

DaveM.

You're not going to be able to joins like that in CAML (or really, any joins in CAML). SharePoint is not a relational database like SQL. You'll have to manually loop through things in order to simulate joins. It's not very efficient (!), but it works.

-Dave





Re: SharePoint - Workflow CAML query and joins

José Regal.

Ok, I knew that but I still hoping some kind of weird misterious methods or something cos the lists size is huge and looping shall be a performance problem but it seems to be the only way




Re: SharePoint - Workflow CAML query and joins

DaveM.

HAve you looked at the SPSiteDataQuery object It might help...



Re: SharePoint - Workflow CAML query and joins

José Regal.

Looks beautiful ... but I'm looking for the way to query using that and there is nothing more described than it is CAML (or something similar) then I 've the same problem, to join the lists in a CAML query




Re: SharePoint - Workflow CAML query and joins

DaveM.

Again, you're not going to be able to do joins in CAML. It just isn't supported. You might be surprised at the performance of looping, although, you're right, it is potentially a big hit.

Dave





Re: SharePoint - Workflow CAML query and joins

José Regal.

Surprised why you know something that I don't cos with lesser loads my SQL server machine, is a monster frame I asure, CPU is going to blow up with that the processor shall melt