Versions Compared

Key

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

...

Overview

In this lesson, we are going to learn in which conditions circumstances the views are useful and how to associate them from 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 case we need to review the “View” script in Wayfast, click on “View Script” pencil icon and you can 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 database and update what we modified in Wayfast.

Recap

In this lesson, we learnt that Views are like a virtual table that contains data from one or multiple tables. 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.

...