Database Reference
In-Depth Information
Figure 12-21.
Page navigation
SQL Tags
Websheets allow administrators and contributors to query tables and views in the
schema. They can create reports that are similar to data grids, except they're read-only.
They can also include query results called
SQL tags
directly in sections.
On the Players page, let's add a section to display the number of registered users
who have access to the application, and include a SQL tag in the section. To create the
section, follow these steps:
1.
Go to the
Players
page.
2.
Click the
New Section
link.
3.
Select
Text
for
Section Type
, and click
Next
.
4.
Set
Sequence
to
5
and
Title
to
Active Registered Users
.
5.
Enter the following text in the
Content
section, and click the
Create Sec-
tion
button:
We currently have[[sqlvalue: select count(*)
from tusers where active_flag = 'Y' ]]active
registered users. They are: [[sql: select
initcap(user_name) "Name" from tusers order by
user_name ]]
in the first line of the preceding code. That query generates the value 3 shown as the
number of active users in the figure. Similarly, the second
select
statement in the
preceding code generates the list of player names.