i have done something similar, but i took another approach.
We also wanted to have result of a SQL Query and have this informations in a Confluence Page in a table format. And we wanted this to be updated on a daily base.
So i wrote a shell script which executes the sql query, generates a csv file, splits this into proper html tags and creates a JSON File out of that all.
This JSON File is uploaded via the Confluence RestAPI.
The Result is that we have our informations from the sql query in a confluence page in a table format. This script is run by an daily cronjob so we always have actual informations in our table in confluence.
You can take a look at the confluence restapi documentation if you want to: https://docs.atlassian.com/ConfluenceServer/rest/6.14.1/
so..you know you can do with with ORDS, yes?
yes, i knew that i can create json with ORDS, but i didn't knew that i can talk directly to the confluence rest api. Because the confluence api needs the informations return by the sql statement in an html table syntax this was my preferred way. And it works like a charm :-)
But i think i will take a closer look to ORDS. Perhaps it will cover it more easily.
Thanks for your reply.
In this instance I am not looking for an advanced solution. My requirement is just to show little data from the database in a tabular format.
I have got my original process little less cumbersome now by pasting the query rows from the SQL Developer 'Query Results' pane to an un-named Excel file and from there to the Confluence page (thereby avoiding the export altogether). I am providing the SQL queries too to the readers of the Confluence page so that they themselves can run the SQL and see the latest results later whenever they want.
1 person found this helpful
Not fully automated, but what i've done when pasting to wiki is export my result-set from grid to clipboard as delimited with a vertical bar as delimiter.
Then, paste result in a fresh worksheet (i actually use gvim), and replace both start of line (^) and end of line ($) with a vertical bar, and finally double the bars in the first header line, done.
It would be nice if this was supported as an extra export format, for sure (but then different wikis support different markups...)
Thanks for the update. I can now use the same technique (Export >> Pipe Delimited >> Clipboard). And in Confluence use an option to Insert Markup (Confluence Wiki). As they are small data sets, I can manually add a pipe character to each of the lines at the beginning and it produces a table which I can then format further. Got rid of the Excel interface now completely now.