/
How to use SQL to find pages
How to use SQL to find pages
Description
This may be appropriate if you have specific requirements and conditions. Otherwise we recommend using the techniques from How to find Confluence pages and then do something
- You are familiar with SQL
- Confluence Server and you have access to the Confluence database
- You want to do exact content search and have a large number of pages which would prevent you from using the Search Content approach because it would take too long.
Steps
- Construct a SQL query that selects the pages you are interested in. Test against your database.
select '--id ' || contentid from content where content.title like '%title 1%' and contenttype = 'PAGE' and content.spaceid = (select spaceid from spaces where spacekey = 'zconfluencecli2')
- Figure out the runFromSql parameters for accessing your database.
Put it all together in a single command:
confluence -a runFromSql --common "-a modifyPage --content \"before existing content\" " --database confluence-3.5.13 --driver postgresql --sql "select '--id ' || contentid from content where content.title like '%title 1%' and contenttype = 'PAGE' and content.spaceid = (select spaceid from spaces where spacekey = 'zconfluencecli2')"
, multiple selections available,
Related content
How to find all pages that use SQL for Confluence (Pro Edition) macros via database
How to find all pages that use SQL for Confluence (Pro Edition) macros via database
More like this
selectPages
selectPages
More like this
CQL Search
CQL Search
More like this
Populate a list with Confluence pages
Populate a list with Confluence pages
More like this
addPage
More like this
getPageList
getPageList
More like this