I'm using AEM 6.2.
Is it possible to update content using a SQL2 query with the Tools, Query, SQL2 tool?
Example Select
select * from [nt:unstructured] as p where isdescendantnode (p, [/content/]) AND [sling:resourceType] like '/apps/project/component%'
and Update the content to '/apps/project/component2'
Thank you in advance for your help.
-Dean
Solved! Go to Solution.
Views
Replies
Total Likes
From description - no.
One more option is a bulk editor
https://docs.adobe.com/docs/en/aem/6-1/administer/operations/bulk-editor.html
But, be aware. From documentation:
Views
Replies
Total Likes
Yes - when using JCR SQL2 - you get back a result set of nodes. You can then update the nodes using JCR API.
Invoke the node's setProperty method to modify the values.
Views
Replies
Total Likes
Can you do it within the query?
Similar to SQL ... UPDATE XXX where ...
Do I have to use JCR API?
-Dean
Views
Replies
Total Likes
Check this tool.
https://adobe-consulting-services.github.io/acs-aem-tools/csv-resource-type-updater.html
I think this is what you are looking for.
This is a GREAT tool. Do you happen to know if I can update ANY/all properties within a given path?
Example:
Path: /content/project/subproject
reference property: sling:resourceType
reference property value: foundation/components/reference
property: jcr:title
new value: This is the new value
I'm trying to find all of the sling:resourceType='foundation/components/reference' with a property of jcr:title and update the jcr:title to 'This is a new value'
Thanks,
-Dean
Views
Replies
Total Likes
From description - no.
One more option is a bulk editor
https://docs.adobe.com/docs/en/aem/6-1/administer/operations/bulk-editor.html
But, be aware. From documentation:
Views
Replies
Total Likes
As per Sling Query documentation, updating directly from query isn't available as of now.
https://github.com/Cognifide/Sling-Query/wiki/Method-list
deana66659071 wrote...
I'm using AEM 6.2.
Is it possible to update content using a SQL2 query with the Tools, Query, SQL2 tool?
Example Select
select * from [nt:unstructured] as p where isdescendantnode (p, [/content/]) AND [sling:resourceType] like '/apps/project/component%'
and Update the content to '/apps/project/component2'
Thank you in advance for your help.
-Dean
Views
Replies
Total Likes
Look at Joerg's answer in this old community thread:
Views
Replies
Total Likes
~~Anton Smulskiy ...
This is probably the best approach for what we're looking for.
Thanks to all for your responses.
-Dean
Views
Replies
Total Likes