Gudu SQLFlow Product Docs
  • 1. Introduction
    • What is Gudu SQLFlow?
      • What SQLFlow can do
      • Architecture Overview
    • Getting Started
      • Sign up a new account
        • Team Management
        • Delete My Account
        • Activate by entering a coupon
      • How to use SQLFlow
      • Different modes in Gudu SQLFlow
        • Query mode
        • Job mode
      • Basic Usage
      • Convert SQL to E-R Diagram
      • Colors in SQLFlow Diagram
      • Show call relationship
    • Installation
      • Version and Users
        • Cloud and On-Premise version
        • SQLFlow before Version 6
          • For older version SQLFlow under Linux
          • For older version SQLFlow under MacOS
          • For older version SQLFlow under Windows
      • Linux
      • MacOS
      • Windows
      • Docker
      • Clickhouse Installation
        • Clickhouse For CentOs
        • Clickhouse For Ubuntu/Debian/RHEL
      • Troubleshooting
      • Upgrade
      • Third Party Components
      • Renew License File
    • UI
      • SQLText Editor
      • Schema Explorer
      • Diagram Panel
      • Settings
      • Job Management
        • Job Sources
    • Dlineage Tool
      • Overview
      • Usage
        • Analyze data linege from SQL files
        • Analyze data linege from a database
        • Resolve the ambiguous columns in SQL query
        • Map the DataFlowAnalyzer and the settings on SQLFlow UI
        • Settings
      • Dataflow.xml structure
      • FAQ
  • 2. CONCEPTS
    • Data Lineage Basics
      • Dataflow
        • Relations generated by SQLFlow
      • Direct Dataflow
      • Indirect Dataflow
      • Aggregate function and Dataflow
      • Dataflow chain
    • Data Lineage Format Reference
  • 3. API Docs
    • Prerequisites
    • Using the Rest API
    • SQLFlow Rest API reference
      • User Interface
      • Generation Interface
        • /sqlflow
        • /sqlflow/selectedgraph/table_level_lineage
        • /sqlflow/selectedgraph/image
        • /sqlflow/graph
        • /sqlflow/graph/table_level_lineage
        • /sqlflow/graph/image
        • /sqlflow/downstreamGraph
        • /sqlflow/upstreamGraph
        • /sqlflow/erdiagramSelectGraph
        • /sqlflow/leftMostSourceTableGraph
      • Job Interface
        • /submitUserJob
        • /displayUserJobSummary
        • /displayUserJobsSummary
        • /exportLineageAsJson
        • /exportFullLineageAsJson
        • /exportLineageAsGraphml
        • /submitPersistJob
        • /displayUserLatestJobTableLevelLineage
      • Export Image
      • Export CSV
        • /sqlflow/exportFullLineageAsCsv
        • /job/exportFullLineageAsCsv
    • Swagger UI
    • Export the data lineage result
    • Python
      • Basic Usage
      • Advanced Usage
    • SQL Parser API
      • checkSyntax
  • 4. SQLFlow Widget
    • Widget Get started
    • Usages
    • Widget API Reference
  • 5. Databases
    • Database Objects
      • Azure
      • DB2
  • 6. SQLFlow-ingester
    • Introduction
      • SQLFlow-Exporter
      • SQLFlow-Extractor
      • SQLFlow-Submitter
    • Get Started
      • SQL Server
    • SQLFlow-Ingester Java API Usage
    • Understand the format of exported data
      • Oracle
      • Microsoft SQL Server
      • MySQL
      • PostgreSQL
    • List of Supported dbVendors
    • Git Repo
    • Third Party Components
  • 7. Reference
    • Lineage Model
      • Json Format Lineage Model
      • XML Format Lineage Model
      • Data Lineage Elements
    • Database Model
  • 8. other
    • FAQ
      • Handling Internal Database
      • Delete Your Account
      • Table Form Data Without Intermediates
      • Not all schema exported from Oracle
      • Lineage Customization
    • Roadmap
    • SQL Samples
      • Exchange table partition
      • Generate relationship for renamed table
      • Snowflake table function lineage detection
    • Change Logs
    • SQLFlow with Oracle XML functions
    • Major Organizations Utilizing SQLFlow
Powered by GitBook
On this page
  1. 1. Introduction
  2. Getting Started

Show call relationship

PreviousColors in SQLFlow DiagramNextInstallation

Last updated 8 months ago

The "Show Call Relationship" feature allows users to automatically generate a detailed SQL procedure invocation relationship diagram. By visualizing how different procedures call and interact with each other, users can gain deeper insights into complex stored procedures and their dependencies.

  • In Editor mode, click the following button to get the call relation

  • Under Job mode, right click the data source and choose "show call relationship" to visualize the invocations

Use Cases:

  1. Tracking Procedure Dependencies: Users can now easily track how procedures interact, making it simple to manage complex systems.

  2. Enhancing Data Governance: This feature is especially valuable for compliance purposes, as it allows data teams to trace how SQL procedures interact across the system.

Let's take following SQL as an example:

CREATE TABLE Employees (
    EmployeeID INT IDENTITY(1,1) PRIMARY KEY,
    FirstName NVARCHAR(50),
    LastName NVARCHAR(50),
    BirthDate DATE,
    HireDate DATE
);

CREATE FUNCTION CalculateAge (@BirthDate DATE)
RETURNS INT
AS
BEGIN
    RETURN DATEDIFF(YEAR, @BirthDate, GETDATE());
END;

CREATE FUNCTION CalculateYearsOfService (@HireDate DATE)
RETURNS INT
AS
BEGIN
    RETURN DATEDIFF(YEAR, @HireDate, GETDATE());
END;

CREATE PROCEDURE CheckEmployeeExists
    @EmployeeID INT,
    @Exists BIT OUTPUT
AS
BEGIN
    SET @Exists = CASE WHEN EXISTS (SELECT 1 FROM Employees WHERE EmployeeID = @EmployeeID) THEN 1 ELSE 0 END;
END;

CREATE PROCEDURE GetEmployeeDetails
    @EmployeeID INT
AS
BEGIN
    SELECT EmployeeID, FirstName, LastName, BirthDate, HireDate
    FROM Employees
    WHERE EmployeeID = @EmployeeID;
END;

CREATE PROCEDURE CalculateEmployeeMetrics
    @EmployeeID INT,
    @Age INT OUTPUT,
    @YearsOfService INT OUTPUT
AS
BEGIN
    DECLARE @BirthDate DATE, @HireDate DATE;
    
    SELECT @BirthDate = BirthDate, @HireDate = HireDate
    FROM Employees
    WHERE EmployeeID = @EmployeeID;

    SET @Age = dbo.CalculateAge(@BirthDate);
    SET @YearsOfService = dbo.CalculateYearsOfService(@HireDate);
END;

CREATE PROCEDURE GetEmployeeSummary
    @EmployeeID INT
AS
BEGIN
    DECLARE @Exists BIT, @Age INT, @YearsOfService INT;

    EXEC CheckEmployeeExists @EmployeeID, @Exists OUTPUT;

    IF @Exists = 1
    BEGIN
        EXEC GetEmployeeDetails @EmployeeID;
        EXEC CalculateEmployeeMetrics @EmployeeID, @Age OUTPUT, @YearsOfService OUTPUT;

        PRINT 'Employee Age: ' + CAST(@Age AS NVARCHAR(10));
        PRINT 'Years of Service: ' + CAST(@YearsOfService AS NVARCHAR(10));
    END
    ELSE
    BEGIN
        PRINT 'Employee does not exist.';
    END;
END;

EXEC GetEmployeeSummary 2;

This SQL contains a relatively complex case which involves different SQL procedure invocations, multiple procedures and functions are get invoked. Using "Show call relationship" brings us the following diagram:

The "Show Call Relationship" feature strengthens SQLFlow’s ability to analyze and manage SQL procedures, giving database administrators and developers more control and visibility into their data environments.