Dynamic Stored Procedure Tool for Database Cursor Management

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Creating and modifying stored procedures is labor-intensive and time-consuming, requiring recompilation and regression testing, especially when changes affect multiple clients or underlying DB2 tables, leading to inefficiencies and increased development and maintenance time.

Innovation Solution

A dynamic stored procedure tool that retrieves input values from a calling program, dynamically retrieves a cursor from an external source, and executes it, allowing for real-time updates without recompilation, enabling flexible and efficient management of result sets and reducing the need for new stored procedures.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If the cursor is hard-coded inside the stored procedure, then the stored procedure structure is simple and easy to maintain, but the cursor cannot be changed without recompiling the entire stored procedure, leading to increased development and maintenance time

Engineering Contradiction:
Improveease of stored procedure modificationVSAvoiddevelopment and maintenance time
Core Design Contradiction:
Ease of manufactureVSProductivity

Solution Approach 1:

The patent segments the stored procedure into two independent parts: the procedure logic and the cursor definition. The cursor is extracted from the hard-coded procedure body and stored separately in a database table. This allows the cursor to be modified independently without recompiling the entire stored procedure, resolving the contradiction between structural simplicity and modification efficiency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent makes the cursor dynamic by retrieving it from a database table at runtime based on input parameters, rather than having it fixed in the procedure code. This dynamic approach allows the cursor to change without procedure recompilation, improving productivity while maintaining procedural logic integrity.

Inventive Principle:
Principle #15Dynamics

2Reliability

If the stored procedure is recompiled whenever the underlying DB2 table structure changes, then data consistency is ensured, but unnecessary recompilation occurs even when changes are not needed, increasing maintenance overhead

Engineering Contradiction:
Improvedata consistencyVSAvoidmaintenance time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent uses parameter substitution to dynamically adapt the cursor to table structure changes. Instead of recompiling the procedure, the system modifies the cursor parameters at runtime based on the actual table structure, ensuring data consistency while avoiding unnecessary recompilation overhead.

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If a new stored procedure is created for each client-specific cursor requirement, then each client's needs are met precisely, but the number of stored procedures increases, complicating system management and increasing maintenance burden

Engineering Contradiction:
Improveclient-specific customizationVSAvoidsystem complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent creates a universal stored procedure that can serve multiple clients with different cursor requirements. By parameterizing the procedure and retrieving client-specific cursors from a database table, a single procedure handles what previously required multiple separate procedures, reducing system complexity while maintaining adaptability.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent introduces a database table as an intermediary between the stored procedure and client-specific cursor requirements. This intermediary layer allows the procedure to dynamically select and adapt to different client needs without requiring separate procedures for each client, simplifying system management.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11449497B1Method and system for implementing dynamic stored procedures
Publication Date: 2022.09.20 JPMORGAN CHASE BANK NA
  • US11449497B1 patent drawing
  • US11449497B1 patent drawing
  • US11449497B1 patent drawing

AI summary

The invention relates to a creating a stored procedure that retrieves its queries from a database, e.g., a DB2 table, and then prepares and executes dynamic SQL based on parameters supplied by a calling program. According to an embodiment of the present invention, a computer implemented system implements a dynamic stored procedure tool and comprises: a memory interface that accesses a database table; an interactive interface that receives a user selection; a processor, coupled to the memory interface and the interactive interface, the processor configured to perform the steps comprising: retrieve input values from a calling program; retrieve a cursor from an external source, using the input values; determine whether one or more parameter substitutions are applicable; and execute the cursor dynamically.