A user with admin permissions (admin) can create custom SQL queries that later may be used by other users as a datasource for reports and charts. Also admin can edit and delete custom SQL queries.
To view/create/edit/delete custom SQL queries use the Custom SQL button on the start window.
To create new custom SQL query:
1. Click the Custom SQL button on the start window.
2. Click the New button.
3. Enter SQL query name and the query code. If you wish to set permissions for the created query right after its saving, select the Proceed to permissions screen check box. Note that you can set permissions later on the Admin page (use the Admin page button on the start window).
Note that you can use stored procedures in the SQL query for those databases where they are supported (MS SQL Server, MySQL, Oracle, etc.).
Example of calling the stored procedure without parameters in MS SQL Server:
Example of calling the stored procedure with parameters in MS SQL Server:
4. Click Save.
When creating a report or chart a user can choose custom SQL query as a datasource (go to the SQL queries tab on the Tables window). Admin can also create new custom SQL query using the New query button and edit the existing SQL queries using the SQL Query button.