After the database connection is created, the data sources can be created for the connection as follows:
- In Sigma Studio, click Connections on the left pane.
The existing connections are listed in the Connections and Data Sources on the right pane. Right-click the connection and select Create Data Source.
The Create Datasource page appears.In the Create Datasource page, enter an unique data source name in the Data Source Name field.
Optional: If you want to create a datasource passing SQL queries, perform the following steps:
Enable the Is SQL? toggle option.
Enter the query on the Data Query field.
Note To apply constructed queries for the data source, refer Applying constructed queries for SQL Data Sources.
Warning It is mandatory to add ‘#’ symbol at the front of the parameter.
Click Parameter Configuration icon to configure the parameter settings.
Select access category and define data types for the parameters on Category and Data Type fields. You can also set a default parameter value on the Default Value field if required.
Click outside the window to save the parameter values.
Proceed to step 9.
Click the Object Name field and select the table, view, or stored procedure name from which you need to fetch the data.
Note Stored procedures are enabled for reports only and are yet to be enabled in App Designer. The input parameters for stored procedure can be passed during the configuration of the base report in Sigma Studio and the values can be altered in Sigma screen as well. Refer Creating a Data Source using Stored Procedure for more information on creating a datasource using stored procedure.
Click the Column IDs field and select the columns to be fetched.
Tip Ensure that the column names in a particular table don't get separated by blank spaces, since the column names with blank spaces will be deemed as void columns and henceforth, no column names should be separated with blank spaces, but however, the underscore symbol can be used to separate lengthy column names for a particular table. To quickly select all the columns for the report, click the Select All () icon. To remove all the selected columns, click the Remove All () icon. To select specific columns, select the checkbox adjacent to the column names as shown in the following screen shot:
Mandatory: Provide the name of the bundle key associated with the property file in the Bundle Key field to make use of resource bundle entries, e.g. common.
Note By default, the Bundle Key value is specified as common. If you want to make use of a different bundle key associated with the property file to make use of resource bundle entries, then you can provide a bundle key of your choice in accordance with the relevant key associated with the property file.
- Optional: You can make use of the Add Labels option to manage resource bundle entries and provide the display names for the data columns fetched from a table, stored procedure, DB view or any other data element and even for the SQL data sources.
- Optional: On the Resource Bundle Entries page, you can provide the display names of your choice for the data columns fetched from a table, stored procedure, DB view or any other data element and even for the SQL data sources.
Optional: Enter the condition for filtering the data in the Where Clause field. For example, the where condition, Price > (select avg(Price) from Products) can be given in the Where Clause field.
Info If suppose, you want to fetch data based on certain values, you will have to specify the exact values in the Where Clause field. For example, consider the following SQL query:
Code Block language sql select * from Products where Product_ID = 'P001'
Here, Product_ID = 'P001' can be given in the Where Clause field.
- Optional: Enter the column names by which you want to sort the data in ascending or descending order in the Order By field.
Click Save to save the data source.
Warning When you try to exit the Datasource screen, before saving the configured DB data source, a warning pop-up message appears, as shown in the following screen shot:
- Click Cancel, if you do not want to exit the Datasource screen.
- Click Ok, if you want to exit the Datasource screen.
The following confirmation message appears:- Click Ok.