More about this Plugin
SQL Table Formatter allows you to query a SQL Database of your choice from within the wiki using a wiki tag. and returning the result in a formatted table. This formatter was originally developed by Scott Clewell for ScrewTurn wiki V2 and later ported to ScrewTurn V3 by Ezequiel Santamaria.
Configuration
To use the provider, you will need to specidy a SQL connection string in order for the provider to become active. The way to create the string is as follows:
Data Source=[DB_SERVER];Initial Catalog=[DB_NAME];User ID=[DB_USER];Password=[DB_PASSWORD]
Usage
Wikitag: {QueryTable parameters...}QUERY{/QueryTable}
ParametersParameter Name -> Data Type
border-width -> integer
border-spacing -> integer
border-style -> string
border-color -> string
border-collapse -> string
background-color -> string
cell-border-width -> integer
cell-padding -> integer
cell-border-style -> string
cell-border-color -> string
cell-background-color -> string
noheaders
cell-font-color -> string
header-font-color -> string
Examples
Example 1The following will select all fields from table USERS from a given database in the configuration section
{QueryTable}Select * FROM USERS{/QueryTable}
Example 2The following selects the top 10 new pages (assuming that the SQL Storage provider is being used).
{QueryTable border-style="none" cell-border-style="none"}Select Top 10 '•' + Name As [10 Most Recent Pages] From Page Order By CreationDateTime desc{/QueryTable}
Example 3Maths problems can be done withing the tags with the correct SQL syntax. The following returns the square root of 167
{QueryTable cell-border-style="none" border-style="none" noheaders}select sqrt(167){/QueryTable}
Help
If you have questions, please contact me on the wiki forum, as I check it regularly.
Updates
Updates to the formatter are currently on halt, but support is constant.
I have received feedback from users asking if I could allow multiple connection strings and SQL variables to the SELECTS.
Please if you're interested in this features, send me an email so I can evaluate how many people are actually looking forward for such features.