The first step to creating a view is to sign up with Deepfo. This can be done on www.deepfo.com, clicking on Portal and then on Sign Up.
Once registered, you must access your dashboard by signing in with your username and password.
The next step is to access Views. This panel will display all the created views.
You can access any of your views or register a new one by clicking on New View.
This will open up an blank form with several fields and several actions:
Fields
Name of the view. This will be the name displayed to other users.
Version. This field is created automatically.
Comment.
Language. Spanish or English.
SQL of the view. You must access the database defined by the selected language.
Description. Explanation of the view, which may be consulted by users from the website.
Price. Amount, in euros, to be paid by users to launch the view.
Actions
Launch. This action will launch the view and the user will be able to see the result.
Validate syntax. This will validate the SQL syntax correction.
Save. To save the data.
Publish. For the view to be visible to all users.
Cancel. To cancel the view. You will not be able to cancel a view if it has received payments.
The user must specify in which group or groups the list is included.
Views with parameter
You can create views with parameters so that they are requested from the user before being launched. The parameters are text inserted into the SQL with the following format
{description#type#Required/optional[#Extension]}
Where:
Description: Defines the parameter. The same parameter can be included several times in the selection. If parameter is repeated, the format will be {descripción} for occurrences two ahead.
Type: Parameter type, which can be:
Date
Time
Number
String
Table
Options
Required/optional: R for required, O for optional.
Extension: Only if the type is table (then it will contain the table) or options (it will contain the options separated by commas). If the type is table, the text entered by the user will autocomplete with the values in the table. If the type is options, the user can choose the value in a combo.
The text that defines the parameter should be written in single quotes (') in the case of the types of parameters time, string, table and options and without single quotes in the rest of the cases.
Examples.
1. View to see people born on a certain date, the date will be requested by parameter when launching the view
Select * from data_en.dbo.person where date_of_birth = {Enter date of birth#date#R}
2. View to see people born in a certain country. The user must enter the country, and the text entered will autocomplete based on the countries in the database.
Select * from data_en.dbo.person where id_country_of_birth = (select id from data_en.dbo.country where name = '{Enter Country#table#R#country}')
On launching the view, the value entered by the user will be replaced in the SQL by the text of the parameter between “{“ and “}” both included.