Supercharge Your Innovation With Domain-Expert AI Agents!

A kind of sql code conversion method and device

A code conversion and code technology, applied in the database field, can solve problems such as complex conversion mapping relationship, errors, complex SQL code, etc., to achieve the effect of improving processing efficiency

Active Publication Date: 2020-09-15
CAINIAO SMART LOGISTICS HLDG LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, in practical applications, the SQL code in the application is often complex (such as involving multi-table association queries, multi-level nested queries, etc.), and the change of data structure is not limited to simple data tables and field name changes, but involves More complex conversion mapping relationship
In this case, directly using text replacement to convert the SQL code may lead to errors, so manual modification of the SQL code involving changes in table names and field names can only be done manually, resulting in low processing efficiency

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A kind of sql code conversion method and device
  • A kind of sql code conversion method and device
  • A kind of sql code conversion method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0024] In SQL, the join operation is used to query data from two or more tables based on the relationship between the columns in these tables. In order to obtain complete results, it is necessary to specify the association conditions between multiple tables, so that Linking data from multiple tables together.

[0025] When actually performing the join operation, the join operation should have at least two operation objects, where the join operation object can be a complete input table, for example:

[0026] select a.col1,b.col2 from

[0027] tab1a

[0028] join

[0029] tab2b

[0030] on (association condition)

[0031] It can also be the query result obtained by a select subquery statement, for example:

[0032] select a.col1,b.col2 from

[0033] (select subquery)a

[0034] join

[0035] (select subquery)b

[0036] on (association condition)

[0037] For the former case, the input table is called the direct operation object of the join operation, for example, tab1 a...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The application discloses a method and device for SQL code conversion. A method for the SQL code conversion is characterized in that the method comprises the steps that a to-be-converted SQL original code segment is analyzed, and whether a replacement table is a direct operation object or an indirect operation object of a join operation is judged when join operation keywords exist in the original code segment; and according to the judgment result, text replacement will be conducted on a to-be-replaced table name and a to-be-replace field name. The scheme disclosed by the application effectively increases processing efficiency of the SQL code conversion.

Description

technical field [0001] The present application relates to the technical field of databases, in particular to an SQL code conversion method and device. Background technique [0002] Structured Query Language SQL (Structured Query Language) is a database operation language. Because of its simple syntax, non-procedural, and flexible usage, it is widely used in the development of various applications involving database operations. In addition, data processing languages ​​used in distributed file systems, such as Hive SQL, ODPSSQL, etc., also use syntax similar to SQL. [0003] Due to the needs of business development, sometimes it may be necessary to modify the data structure of the underlying database, which may involve changes in data table names and field names. In order to ensure the usability of the SQL code, it is necessary to change the table name and field name involved in the original SQL code to the new table name and field name. If the SQL code used in the implement...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/2453
CPCG06F16/24534G06F16/24537
Inventor 蔡聪李剑平
Owner CAINIAO SMART LOGISTICS HLDG LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More