Hi,

On Thu, Oct 22, 2009 at 16:02, Bahl Christian <[email protected]> wrote:
> Hi,
>
> i´ve the following sql query:
>
> SELECT * FROM nt:unstructured WHERE title='any title' AND 
> articleDocument='false' AND /companyIds/collection-element IS NULL AND 
> /menuIds/collection-element/menuId='1234'
>
> Now my problem is this part " AND /companyIds/collection-element IS NULL AND 
> /menuIds/collection-element IS NULL". It shows error in sql query language.
> So my question: is it possible to do search properties on childnodes with sql 
> query language?

no, this is not possible.

> If so, can you please give me some examples?

you should use XPath instead:

//element(*, nt:unstructured)[...@title='any title' and @articleDocument
= 'false' and not(companyIds/@collection-element) and
menuIds/collection-element/@menuId = '1234']

notes: JCR does not have null values, so you check for the existence
of a property. paths that start with a slash are absolute (which is
probably not what you want here...).

regards
 marcel

> Thx
> Christian
>

Reply via email to