GE Proficy Plant Applications ResultSets

ResultSets are the primary interface mechanism between stored procedures and the frontend in GE Proficy Plant Applications. They provide structured, real-time database updates through the messaging infrastructure rather than direct SQL operations.

See https://www.gevernova.com/software/documentation/proficy-plant-applications/

Overview

What are ResultSets?

ResultSets allow you to add real-time messages to:

  • Model-based custom SQL Stored Procedures
  • Variable Stored Procedure Calculations

Instead of directly updating the Plant Applications database with SQL INSERT and UPDATE statements, ResultSets use the Plant Applications Messaging infrastructure to:

  1. Make database changes safely
  2. Notify currently running Clients of changes in real-time
  3. Trigger dependent calculations and workflows

The Challenge: No Meaningful Headers

Critical Issue: When stored procedures return ResultSets, they return only data without meaningful column headers. This makes debugging extremely difficult as developers must know the expected field order and meaning by consulting documentation or the ResultSetConfig table.

ResultSet Architecture

Configuration

  • Configuration Table: ResultSetConfig table defines all available ResultSet types
  • Format: ResultSets return data in a specific field order (Order 0, 1, 2, etc.)

Messaging System

Plant Applications employs a messaging system where ResultSets:

  • Provide access to the messaging infrastructure
  • Enable real-time client notifications
  • Support multi-user concurrent operations
  • Maintain data consistency across the application

ResultSet Types

Type 2: Variable Values ResultSet

The Variable Values ResultSet captures variable measurements and updates within Plant Applications.

Operations: Add and Update (no Delete - use NULL to effectively delete)

Field Structure:

OrderField NameData TypeSource/ValuesDescription
0Result Set TypeINTAlways 2Identifies this as Variable Values ResultSet
1Variable IdINTTests.Var_IdReferences the variable being measured
2Production Unit IdINTVariables.PU_IdProduction unit context
3User IdINTTests.User_IdUser entering/updating the value
4CancelledINT0 = False
1 = True
Whether the test is cancelled
5ValueVARCHAR(50)Tests.ResultThe actual measurement value
6TimestampVARCHAR(50)Tests.Result_OnWhen the measurement was taken
7Transaction TypeINT1 = Add
2 = Update
Type of database operation
8Update TypeINT0 = Pre-Update
1 = Post-Update
Update phase (affects dependent calculations)

Important Notes:

  • No Delete Function: To delete variable values, update the value to NULL
  • Post-Update Impact: When update type is post-update (1), dependent calculations won’t trigger automatically
  • Pre-Update Usage: Use pre-update (0) when you need dependent calculations to fire

Quality Module Usage

The Quality Module makes heavy use of Variables and Calculations that call stored procedures. The interface back to the frontend is encoded in the types of ResultSets returned by the stored procedures.

Common Quality Module Patterns:

  • Variable measurements (test results, inspections)
  • Statistical process control (SPC) calculations
  • Quality limits and specifications
  • Defect tracking and non-conformance
  • Sampling plans and test procedures

Alternative Approaches

HotAdds

In rare cases where:

  • Multiple updates occur within one stored procedure
  • The local stored procedure relies on having an “ID” returned before the “Next Step”

Sites may bypass ResultSets and call SpServer_DBMgr* stored procedures directly.

Pattern:

  1. Call SpServer_DBMgr* stored procedure (bypasses ResultSet)
  2. Followed by a post-update ResultSet
  3. Use when simple pre-update ResultSets are insufficient

SpServer_DBMgr* stored procedures are generally used “in place of a ResultSet” for complex multi-step operations.

Best Practices for Creating Stored Procedures

When creating stored procedures that use ResultSets:

  1. Create a table variable for the ResultSet with a field for each parameter
  2. Allow default values for some fields where appropriate
  3. Create local variables for each field that the ResultSet will update
  4. Add flow control variables for program flow and error checking
  5. Use consistent naming matching the ResultSet field order

Example Pattern

-- Create table variable for ResultSet  
DECLARE @VariableResults TABLE (  
    ResultSetType INT,  
    VariableId INT,  
    ProductionUnitId INT,  
    UserId INT,  
    Cancelled INT,  
    Value VARCHAR(50),  
    Timestamp VARCHAR(50),  
    TransactionType INT,  
    UpdateType INT  
)  
  
-- Populate with precise values  
INSERT INTO @VariableResults  
SELECT  
    2 as ResultSetType,  -- Type 2 = Variable Values  
    Var_Id,  
    PU_Id,  
    @UserId,  
    0 as Cancelled,  
    CAST(Result as VARCHAR(50)),  
    CONVERT(VARCHAR(50), GETDATE(), 121),  
    1 as TransactionType,  -- 1 = Add  
    0 as UpdateType  -- 0 = Pre-Update  
FROM Variables  
WHERE [conditions]  
  
-- Return ResultSet  
SELECT * FROM @VariableResults  

Debugging ResultSets

Common Issues

  1. Unknown Field Order: Without headers, you must know the expected field positions
  2. Type Mismatches: Data types must match exactly what the ResultSet expects
  3. Missing Required Fields: All fields in the expected order must be present
  4. Null Handling: Some fields may not accept NULL values

Debugging Strategies

  1. Consult ResultSetConfig Table: Query the database configuration
  2. Reference Documentation: Use official GE Vernova documentation (ProficyPAResultSets.chm)
  3. Use Test Queries: Create test stored procedures to verify field order
  4. Add Logging: Create audit trails in custom tables for troubleshooting
  5. Version Control: Track stored procedure changes with clear comments

Querying ResultSetConfig

-- Find ResultSet configuration  
SELECT * FROM ResultSetConfig  
WHERE ResultSetType = 2  -- Variable Values  
  
-- List all ResultSet types  
SELECT DISTINCT ResultSetType, Description  
FROM ResultSetConfig  
ORDER BY ResultSetType  

Core Tables for Quality Module

  • Tests: Quality test results and measurements
  • Variables: Variable definitions and specifications
  • ResultSetConfig: ResultSet type definitions
  • Production Units: Manufacturing context
  • Users: User information for audit trails

Quality-Specific Tables

  • Quality Limits
  • Sampling Plans
  • Test Procedures
  • Non-Conformance Records
  • Statistical Control Charts

Documentation References

Official Documentation

Community Resources

Key Takeaways

  1. ResultSets are the Interface: They encode the contract between stored procedures and the frontend
  2. Field Order Matters: Without headers, you must know the exact field order
  3. Real-Time Updates: ResultSets use messaging infrastructure for live updates
  4. Quality Module Dependency: The Quality Module heavily relies on ResultSets for calculations
  5. Documentation is Critical: Keep ResultSet field definitions documented for your team
  6. Use Pre-Update for Cascades: Set UpdateType = 0 when you need dependent calculations to trigger

Additional Notes

Known ResultSet Types

Based on Plant Applications modules, other ResultSet types likely include:

  • Production Events
  • Downtime Records
  • Material Consumption
  • Waste Tracking
  • Work Order Updates
  • Route Management
  • Non-Conformance Records

Note: The complete list of ResultSet types with field definitions is available in the official Result Sets PDF documentation (46 pages). Contact GE Vernova support or consult the installed help files for comprehensive field mappings.

Version Compatibility

This documentation is based on:

  • Plant Applications 8.2
  • Plant Applications 2023
  • Plant Applications 2024

Field structures may vary between versions. Always consult version-specific documentation.