SQL2 query related doubt | Adobe Higher Education
Skip to main content
Level 9
October 16, 2015
Risolto

SQL2 query related doubt

  • October 16, 2015
  • 6 risposte
  • 1298 visualizzazioni

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.

Questo argomento è stato chiuso alle risposte.
Migliore risposta di 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 risposte

Lokesh_Shivalingaiah
Level 10
October 16, 2015

Hi,

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

Sham_HC
Sham_HCRisposta
Level 10
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
Level 10
October 16, 2015

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

askdctmAutore
Level 9
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.

askdctmAutore
Level 9
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
Level 10
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