Stored Procedures
The Stored Procedures dialog runs predefined database procedures before a visualization loads. You enter parameter values, the procedure runs on the database server, and the results populate your visualization automatically. The dialog can appear when you open a view, a dashboard, a report, or a workbook.
Stored procedures are useful for transforming data, automating repetitive SQL tasks, and controlling what data gets loaded into a visualization. The Stored Procedures option appears in the context menu only if your data model role includes the Manage Stored Procedures permission.
When to use stored procedures
- Transforming complex data: Run multiple SQL statements automatically before a visualization opens so you don't repeat the same manual steps each time.
- Automating repetitive SQL tasks: Use procedures to apply the same SQL logic consistently every time a visualization opens, reducing manual effort and the risk of errors.
- Improving load performance: Process data directly on the database server to reduce the amount of data sent to the application.
- Controlling SQL execution: Manage how SQL commands run to limit access to your data and reduce the risk of SQL injection.
- Filtering data dynamically: Pass parameters into a procedure so it returns only the data that matches your input, instead of loading everything and filtering after the fact.
Run a stored procedure
If the data model includes a stored procedure, the Stored Procedures dialog opens automatically when you open a visualization. You must confirm or skip the dialog before the visualization loads.
- Open a view, report, dashboard, or workbook.
- Enter a value for each field. Select the prompt button beside a field to see the available values.
- Select Confirm, or Skip to load the visualization using the default values.
Select Don't ask again this session to save your current values. The dialog won't appear again for the rest of the session.
Stored procedures dialog options
| Option | What it does |
|---|---|
| Name | The name of the stored procedure that runs when you select Confirm. |
| Parameters | The input fields required to run the procedure. Every parameter has a default value, so you can always select Skip if you don't need custom values. |
| Prompts | A button beside each input field that shows the available values for that parameter. Use this if you're unsure what to enter. |
| Don't ask again this session | Saves your current parameter values for the rest of the session. The dialog won't open again until your next session. |
| Skip | Closes the dialog and loads the visualization using the default parameter values. No procedure runs with custom input. |
| Confirm | Run the stored procedure with your parameter values and load the visualization. |