Product: TIBCO Spotfire®
How to embed parameters in Information link using Stored Procedure to work with Scheduled Updates in TIBCO Spotfire Web Player
When a parameterized Information Link is used in a Spotfire analysis, it may be assumed that the parameter values provided while importing the Information link shall be saved in the analysis and the same parameter values are used by Scheduled Updates while caching the analysis or just opening the analysis on the TIBCO Spotfire Web Player. But this is not the case.
When parameter values are passed to a Stored Procedure through an Information Link, if you only follow the below steps, your cache refresh for the analysis using Scheduled Updates will fail.
Scenario 1: Stored Procedure with no default value
- Create a Stored Procedure element with Prompt value as "None"
- Import the Stored Procedure element in an Information Link. If you click the "SQL..." button the SQL will be like: { call "SYSTEM"."F_GET_COUNTRIES"(?) }
- Refresh the Parameter section in the Information Link. As no default value for the parameter is specified, it will show nothing. So you may edit the SQL by providing a parameter name like { call "SYSTEM"."F_GET_COUNTRIES"(?inputparameter) }. Now refresh the parameter section in the Information Link and you will find "inputparameter" with the option to set its data type and value type
- Save the Information Link
- In the analysis, select File > Add Data Tables > Add > Information Link and select the Information Link saved in Step 4. It will prompt for inputparameter value and load the data based on the provided value.
- Save the analysis in the Library
- Create a Stored Procedure element with Prompt value as "None" and default value as ?inputparameter
- Import the Stored Procedure element in an Information Link. If you click the "SQL..." button the SQL will be like: { call "SYSTEM"."F_GET_COUNTRIES"(?) }
- Refresh the Parameter section in the Information Link and you will find "inputparameter" with the option to set its data type and value type
- Save the Information Link
- In the analysis, select File > Add Data Tables > Add > Information Link and select the Information Link saved in Step 4. It will prompt for inputparameter value and load the data based on the provided value.
- Save the analysis in the Library
There may be other scenarios where you need to use same Information Link in multiple analysis files but with different parameter values, so you would want to embed the parameter value in each analysis individually. Option 1: Not using an on-demand data table
- Create a Stored Procedure element without a default value and a single prompt value
- Import the Stored Procedure element in an Information Link. If you click the "SQL..." button the SQL will be like: { call "SYSTEM"."F_GET_COUNTRIES"(?) }
- Save the Information Link
- In the analysis, select File > Add Data Tables > Add > Information Link and select the Information Link saved in Step 3
- A Prompt dialog box will appear. Provide prompt values while adding the Information Link in analysis
- Save the analysis in the Library
Option 2: Using an on-demand data table
- Create a Stored Procedure element with Prompt value as "None" and default value as ?inputparameter
- Import the Stored Procedure element in an Information Link. If you click the "SQL..." button the SQL will be like: { call "SYSTEM"."F_GET_COUNTRIES"(?) }
- Save the Information Link
- In the analysis, select File > Add Data Tables > Add > Information Link and select the Information Link saved in Step 3.
- In the prompt dialog boxes, provide the prompt values
- While adding the Information Link, select "Load on demand" option in the "Load method" section
- Save the analysis in the Library
- Save dashboard and open on TIBCO Spotfire Webplayer. It will open up successfully
- Then cache the dashboard and it will be cached as well.
Note: On-demand data tables always cache the first set of data with the provided input parameter value. So both the first and second options will return the same results.
Doc: Parameterized Information Link
Doc: On Demand Data Tables
Doc: Scheduled Updates
Comments
0 comments
Article is closed for comments.