SQL2 query related doubt | Community
Skip to main content
New Participant
October 16, 2015
Solved

SQL2 query related doubt

  • October 16, 2015
  • 6 replies
  • 1297 views

1] SELECT * FROM [nt:base] AS page WHERE ISDESCENDANTNODE(page, '/content/abcd') AND page.[cq:lastReplicated] > CAST('2010-02-01T00:00:00.000+02:00' AS DATE) AND   page.[cq:lastReplicated] < CAST('2010-02-07T00:00:00.000+02:00' AS DATE)

The above works absolutely fine in CRXDE Lite-> Tools->Query.

2] Now I want to run the same query, but also want pages under location efgh to be listed. Tried replacing occurence in #1 with this WHERE(ISDESCENDANTNODE(page, '/content/abcd') or ISDESCENDANTNODE(page, '/content/efgh')), but it is not working.

Any pointers will be helpful.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

Make sure when you run second time with different path the type in crxde light query editor selected correctly. Or other reason may be repository is corrupted. https://helpx.adobe.com/experience-manager/kb/RepositoryInconsistency.html

6 replies

Lokesh_Shivalingaiah
New Participant
October 16, 2015

Hi,

Theoritically it should work. Can you post the error you are seeing here

Sham_HC
Sham_HCAccepted solution
New Participant
October 16, 2015

Make sure when you run second time with different path the type in crxde light query editor selected correctly. Or other reason may be repository is corrupted. https://helpx.adobe.com/experience-manager/kb/RepositoryInconsistency.html

smacdonald2008
New Participant
October 16, 2015

How are you running it - are you running it from within Java within an OSGi bundle? 

askdctmAuthor
New Participant
October 16, 2015

Hi bsloki,

Thank you for your reply.

"Query execution resulted in an error" is all we get. Nothing much was to be seen in the error logs too. Anything specific we need to check here.

askdctmAuthor
New Participant
October 16, 2015

Hi Sham,

Thank you for your reply.

Details as seen below :

-the type in crxde light query editor is the same the second time too.

- A strange thing is if we try with folders 4 level deep it works fine, say WHERE(ISDESCENDANTNODE(page, '/1/2/3/4') or ISDESCENDANTNODE(page, '/5/6/7/8')). Not sure why is this weird behavior observed.

- Also, I guess the repository is fine.

smacdonald2008
New Participant
October 16, 2015

There are JCR SQL2 issues with the type of query. There may be performance issues with more than 4 levels deep. Not related to AEM. 

Look at Apache docs. Check here for starters:

https://issues.apache.org/jira/browse/JCR-2835