SQL Querie parameters
Dernière mise à jour
Cet article vous a-t-il été utile ?
Dernière mise à jour
Cet article vous a-t-il été utile ?
You can set some query parameters in order to filter your queries in real time, using the values entered or selected by the user when opening the dashboard.
To create a query parameter, you have to use the @ symbol the texte of your query : @parameter_name
In the example below, the query filters the users according to the email typed by the user in the prompt .
Then, in the Biwee software, you can type the value that will be given to the query
When the dashboard is opened on the web, the user gets the following prompt :
The user can change the values of the parameters several times, by clicking on the icon below on the top right corner of the dashboard
You can configure query parameters to define the label, the data type, the input type : dropdown list, date selector, free input...
To do so, click in the Settings menu, and then on Query parameters.The window to configure query parameters appears :
Data type :
Automatic : Biwee sends the value of the parameter as it is entered by the user without any changes
String : the value selected or entered by the user will be given to the query as a text value : it will be surrounded automatically with ' '.
DateTime : the user will have a calendar to select a date. This date will be given to the query using the format indicated in the format column.
Int32 : the value given to the query will be the value entered by the user : it will not be surrounded by ' '.
Decimal : the value given to the query will be the value entered by the user : it will not be surrounded by ' '.
This text will be displayed in the prompt displayed to the user to enter his values.
Default value :
You can specify a default value to be passed as a parameter to the query. If all the query parameters have a default entry value, the user will not see the parameter prompt when the dashboard is opened.
He will be able to change the values by clicking on the icon below :
If you want the user to select one or many values in a drop-down list, you can enter the values to display to the user, separated by a ','
Example : value 1, value 2, value 3 displays to the user the drop-down list below :
Check this box if you want the user to be able to select several values in the drop-down list and have them passed as values to the query
This box must be filled in for date parameters only, in order to specify to Biwee the format in which the date selected by the user in the calendar will be returned.
The format to be specified depends on the type of database being queried.
SQL Server
'yyyy-MM-dd'
MySQL
DATE 'yyyy-MM-dd'
PostgreSQL
'yyyy-MM-dd'
If the dashboard is integrated into an application using IFRAME, check this box if you want the user to be able to change the parameter values. Otherwise, only the values passed during the IFRAME call will be used, and the user will not be able to change them.