Skip to main content
September 27, 2022
Solved

JCR Query expected static operand

I am trying to compare a value in my query with the returned values of a subquery.

 

The structure looks like the following:

 

SELECT * as node 

FROM [nt:unstructured]
WHERE node.[ATTR] in (SELECT otherNode.[ATTR] FROM … )

 

I get „expected: static operand“ error. Any suggestions on this?

PS: The query is a lot more complicated but the subquery returns the correct values. And also the main query returns the correct values (oc without the IN clausel) 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
lukasz-m
lukasz-mAccepted solution
Community Advisor
September 27, 2022

Hi @arener09,

Sub queries are not supported by JCR, so the syntax you are trying to use will not work. Please have a look into official jackrabbit documentation, to get all the details about supported syntax/grammar that can be used to build proper query:

2 replies

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
September 27, 2022

Hi @arener09,

Sub queries are not supported by JCR, so the syntax you are trying to use will not work. Please have a look into official jackrabbit documentation, to get all the details about supported syntax/grammar that can be used to build proper query:

Translate
Arener09Author
September 28, 2022

Thank you very much, you saved me so much time. I had to find a work around for this.

Translate