Table DB
Topics |
Table DB Usage ManualThe tabledb plugin enables you to manipulate tables in pmwiki.
The tabledb syntax:(:tabledb action=<someaction> alias=<tabblealiasname> page="<group.pagename> table=<tablereference> row=<rownumber>":)
Attributes
Action AttributeCan be
readreads and appends table(s) into memory. This action requires the page attribute.
Example - read the tables into memory from 2 pages:
(:tabledb action=read page="Main.ReadTable6":)
(:tabledb action=read page="Main.ReadTable7":)
Example - read tables into memory setting an alias for each table name - note that since there are multiple tables the alias will be frog1, frog2, frog3, etc:
(:tabledb action=read alias=frog page="Main.ReadTable7":)
displaydisplays table(s) from memory
Example - from memory display the tables that were from a specific page:
(:tabledb action=display page="Main.ReadTable7" :)
Example - from memory display the tables from and alias:
(:tabledb action=display alias=frog3 :)
initializeclears the memory
(:tabledb action=initialize :)
dbverdisplay the current sqlite version
(:tabledb action=dbver :)
phpverdisplay the current PHP version
(:tabledb action=phpver :)
sqlexecute sqlite SQL statements on tables that have been read into memory
(:tabledb action=sql query="SELECT * FROM magazines2 WHERE Year BETWEEN 2000 AND 2003 ":)
Alias AttributeTHE ALIAS NAME MUST BE UNIQUE
This attribute is for referencing a particular table in memory or in the sqlite database queries. The 'read' action can put tables into memory in this form:
An alias that is assigned to a single table will use the exact aliasname.
An alias specified for a single read action which reads multiple tables appends the table number.
Tables can be referenced via the aliasname in the sql queries and in the 'display' action. Page AttributeThis attribute is currently required when using the 'read' action. The page name referenced must be of the form GROUPNAME.PAGENAME. You must include the group name, a period, and the pagename. You cannot just have the name of the page without the group name and the period. Example:(:tabledb action=read page="Main.ReadTable7":)
Omitting this for the 'display' action will display all the tables from memory. Table AttributeThe 'table' attribute can be a number or a pmwiki anchor(approve sites). The anchor must have a '#' - as in '#anchorname'. Table number example:(:tabledb action=read page="Main.ReadTable7" table="2" :)
Omitting this attribute for the action=display will display all the tables in memory Table Anchor example:In the wiki page where the table is located there would be an anchor line in front of the table like this:
[[#apple]]
The the table attribute can then refer to the table using an anchor attribute
(:tabledb action=read page="Main.ReadTable7" table="#apple" :)
Omitting this attribute from the 'read' action will read all the tables on the page. Specifying a page attribute and omitting this attribute from the 'display' action will display all the tables in memory that came from that page. Omitting the page attribute and this attribute from the 'display' action will display all the tables in memory. Row AttributeThe row is the number of a row to display.
Omitting this attribute will display all the rows. SQLITE SQL syntax is documented here: http://www.sqlite.org/lang.html(approve sites) |
tahi Page last modified on 2016 Jul 26 19:13
Edit - History - Recent Changes - WikiHelp - Search - email page as link -> mailto:?Subject="KiwiWiki: Table DB Usage Manual"&Body=