Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Overview

In this documentlesson, we are going to see learn in which circumstances the views are useful and how to associate views them from DB database in Wayfast.

What is a View in SQL?

A “View” is a virtual table based on the result-set of an SQL statement. You can think on a query that is stored on SQL and when used by a user, it will look and act just like a table but it’s not because does not have a definition or structure. Also the “View” does not require any storage in a database because it does not exist physically. We can also control user security for accessing the data from the database tables and we can allow users to get the data from the “View” and the user does not require permission for each table or column to fetch data.

https://www.sqlshack.com/create-view-sql-creating-views-in-sql-server/

...

Let’s check the syntax for an easy view in SQL that we can use later in the application:

Code Block
languagesql
CREATE VIEW Vw_TablaHWD_PruebaLAFTest
AS 
  SELECT * FROM HolaHello_MundoWorld_Tabla_PruebaDemo   

After executing the new view in SQL, we can synchronize in Wayfast and make it available for association in our project. Open Wayfast and click on “End Task” button at left side navigation bar

...

A popup is displayed and there’s no need to change any requirement. We are going to synchronize Wayfast to get the new view available for development.

...

How to associate

...

Database’s Views in Wayfast?

Info

As precondition, make sure you have an “Active” requirement in Wayfast before starting this process.

In Wayfast, click on “Database” header icon at top menu and then click on “Views” tab

...

You can find “Views” dashboard with all the columns related to the objects related to the Project. We are going to click on “Associate Views” button to add the new view created in SQL and previously synchronized.

...

A popup is displayed on screen. You can retrieve all the “view” objects from the specific instance and database selection. Click on “Assign” button after selecting the view

...

In case we need to review the “View” script in Wayfast, click on “View Script” pencil icon and you can review verify the function associated to the project. Query Analyzer will be opened in another tab to verify the syntax

...

In case you have to edit the script, “Synchronize” button will establish the connection to the DB database and update what we modified in Wayfast.

Recap

In this documentlesson, we learnt that Views are like a virtual table that contains data from one or multiple tables. Then Also we explained how to create and edit view’s statements in SQL that we can easily synchronize them by selecting the correct instance in Wayfast.

...