How to Create VE Project with PowerBuilder + SQL Server Code

This tutorial includes 4 steps:

Step 1 - Check the Requirements

Before you start:

  • Download the latest build, and update your configuration.
  • Verify that your key supports both PowerBuilder and SQL Server:
    Go to Help → License & Product Info. Check the "Key Features" in the right panel.
    VE Key Supported languages
    If needed, read this article to request a new key

  • Identify 1 set of PB code: 1 PB target OR 1 set of files/folders containing the PBLs
  • Identify 1 set of Transact-SQL code: 1 connection to a SQL Server DB OR 1 set of files/folders containing Transact-SQL code and DDL statements (create table, etc.).

Step 2 – Add PowerBuilder code

  • Click ‘New’ on the ribbon menu and select ‘PowerBuilder’ in the next pop-up.
    Select PowerBuilder Code to analyze
  • Choose your PB version. Then, click on ‘PowerBuilder library folders/files’.
    Select PowerBuilder Folders/Files to Analyze
  • Specify the location of your PB code by clicking on “Add files”. Then, click "Next".
    Add PowerBuilder Files
  • Select "Add more code in your Visual Expert project". Click ‘Finish’.
    Add more code for analysis in Visual Expert

Step 3 – Add SQL Server Code

  • Select "Transact-SQL" to add SQL Server code for analysis.
    SQL Server Transact-SQL Code
  • Click on ‘Folders and/or files’.
    Specify SQL Server files to analyze
  • Specify the location of your SQL Server code by clicking on “Add files”.
    Then click on ‘Finish’.
    Add SQL Server files to analyze

Important: if you're connecting to a database, Visual Expert will analyze all the objects accessible from this connection, including all schemas, tables, procedures, system objects, etc.  In this case, it is highly recommended to filter the DB objects you wish to analyze:
If you click on "More Filters" you get the following options:

DB objects listed by default by Visual Expert

  • Once your object selection is completed, click ‘Next’ > then select "Open project setup".
    Open Visual Expert project Setup 
  • Name your Visual Expert project.
  • Set the scheduler to refresh your code analysis automatically on a regular basis.
  • Select "Launch the analysis".
  • After analysis, you will see both PowerBuilder and SQL Server objects in the treeview:

    List of PowerBuilder and SQL Server objects found by Visual Expert
  • You will also see 2 sources of code in your VE project.
    Go to [Code Analysis - Select Source Code].
    PowerBuilder and Oracle source code location

Step 4 - Remove Ambiguities and Duplicate Tables

Why this step?

Consider the following SQLs:

 Select  firstname,  lastname from  employee 
 Select  firstname,  lastname from  myschema.employee 

This basic example may create an ambiguity:
By default, the Visual Expert code parsers cannot know whether employee and myschema.employee refer to the same table. Unless we remove this ambiguity, Visual Expert will duplicate the table employee.

Please read this article to remove possible ambiguities in your project.