This question about Documentation: Asked
hi!
I am using your great sqlPlugin, but I can't get behind the Syntax for Format, Header, footer...
For example, when retrieving a single row and column from a database, how to avoid the column title in the Output? I just want to use the Information given in the data field without the heading.
Maybe you can provide one or two short examples on how to use Format, Header, footer?
--
RalfWigand - 21 Jul 2014
The formatting syntax is the same as in other Foswiki macros. The only trick is to know that the row values are in
$variables
named after the table column names.
By trial and error I came up with this:
%SQL{database="myDatabase" query="SELECT field1,field2 FROM myTable WHERE myParameter like ?" params="foo%" header="" format="| $field1 | $field2 |$n"}%
If you want to customize the header:
%SQL{database="myDatabase" query="SELECT field1,field2 FROM myTable WHERE myParameter like ?" params="foo%" header="| Column 1 | Column 2 |$n" format="| $field1 | $field2 |$n"}%
--
RafaelVarela - 13 Jul 2017