apex_add_leaderboard
Add a ranked leaderboard table to an Oracle APEX page. Provide a SQL query with label and value columns, ordered by value descending, to display top rows with medals and custom styling.
Instructions
Add a ranked leaderboard table. SQL must alias RANK, NAME, VALUE.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"page_id": "<page_id>",
"region_name": "<region_name>",
"sql_query": "<sql_query>"
},
"name": "apex_add_leaderboard"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | Accent color for progress bars. | unimed |
| page_id | Yes | Target page ID. | |
| max_rows | No | Maximum rows to display (default 10). | |
| sequence | No | Display order on page. | |
| sql_query | Yes | SQL returning rows with label and value columns. ORDER BY value DESC should be in the SQL. Example: "SELECT t.DS_NOME LABEL, COUNT(*) VALUE FROM TEA_TERAPEUTAS t JOIN TEA_AVALIACOES a ON a.ID_TERAPEUTA = t.ID_TERAPEUTA GROUP BY t.DS_NOME ORDER BY 2 DESC" | |
| custom_css | No | Additional CSS rules injected into the style block. | |
| region_name | Yes | Region display name (shown as header). | |
| show_medals | No | Show medal icons for top 3 (default True). | |
| label_column | No | Column name for the item label (default "LABEL"). | LABEL |
| value_column | No | Column name for the numeric value (default "VALUE"). | VALUE |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |