Code Module Transformation for SQL Nested Expression Flattening

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database applications face challenges in transforming code modules from programming languages that utilize nested expressions to those that do not, particularly when converting from Structured Query Language (SQL) to Oracle® LoCode, as existing methods struggle with maintaining functional equivalence and avoiding naming collisions in flat namespaces.

Innovation Solution

A system is employed to identify nested expressions in SQL code modules and transform them into non-nested expressions using predefined techniques, such as JOIN and semi-JOIN, while applying naming conventions to ensure unique and consistent operand names, utilizing machine learning models for optimal transformation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If nested expressions in SQL code modules are transformed to non-nested expressions in LoCode, then the code can be executed in LoCode environment, but naming collisions occur in flat namespaces

Engineering Contradiction:
Improvecode portabilityVSAvoidfunctional equivalence
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The transformation system segments the code transformation process into distinct phases: analyzing nested expressions, generating non-nested equivalents, detecting naming collisions, and resolving conflicts through renaming. This segmentation allows systematic handling of the contradiction by addressing naming collisions as a separate step after functional transformation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary transformation layer that converts SQL nested expressions to LoCode non-nested expressions through intermediate representations. This intermediary process includes generating candidate transformations, evaluating their functional equivalence, and using machine learning models to select optimal transformations that maintain reliability while achieving portability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If machine learning models are used for code transformation, then transformation accuracy improves, but computational complexity increases

Engineering Contradiction:
Improvetransformation accuracyVSAvoidsystem complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system performs preliminary actions by pre-processing the SQL code into an intermediate representation, pre-training machine learning models on code transformation datasets, and pre-establishing mapping rules between SQL and LoCode constructs. This preliminary preparation reduces the complexity during actual transformation execution while maintaining high accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent applies parameter changes by adjusting machine learning model parameters based on the specific transformation context, using different model configurations for different types of nested expressions. The system dynamically selects and tunes model parameters to optimize transformation accuracy for specific code patterns while managing computational complexity.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20260079683A1Transforming Code Modules To Different Programming Languages
Publication Date: 2026.03.19 ORACLE INT CORP
  • US20260079683A1 patent drawing
  • US20260079683A1 patent drawing
  • US20260079683A1 patent drawing

AI summary

Techniques for transforming code modules to different programming languages are disclosed. A system accesses a first non-code representation of a first code module expressed in a first programming language and parses the first non-code representation to identify a nested data element of the first non-code representation that represents a nested expression of the first code module. The system executes a transformation technique to transform the nested data element, in the first non-code representation, to a first non-nested data element in the first non-code representation. The system modifies the first non-code representation based on one or more attributes of a second programming language to generate a second non-code representation suitable for representing code modules in the second programming language. The system generates a second code module based at least on the second non-code representation.