Versions Compared

Key

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

Overview

In this lesson, we will learn how to create a new function in SQL and associate this new object in Wayfast. If we have to repeatedly write large SQL scripts to perform the same task, we can create a function that performs that task.

Let’s review how we can simply call that function instead of rewriting scripts.

Create a Function in SQL and link to the Project’s DB

First we need to create an easy function in SQL to establish a currency format in our application. We can follow these recommendations to create the function:

...

Automatically the new function is displayed on the “Functions” section

How to associate an existing Function in Wayfast?

In case we want to include functions previously generated in the new project, we can assign the elements selecting the specific database where they are allocated and include them for development.

...

The new object is displayed on “Functions” dashboard. In case you need to add multiple functions at the same time from one specific database, we can check “Multi Assign” checkbox

...

All the functions are going to be listed in the popup and ready to be checked for assignation.

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

...

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

Recap

Wayfast brings multiple tools to develop our projects. In this lesson, we learnt how to create and edit function’s statements. This approach give us an easy wat to synchronize the objects between database and application selecting the correct instance.

...