SQL (Structured Query Language) statement processing method and device, equipment and storage medium

By designing SQL statement processing methods, obtaining and replacing placeholders in MyBatis, the problem of parameter replacement errors and inefficiency is solved, and the problem detection speed is improved.

CN119202129APending Publication Date: 2024-12-27PING AN BANK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411235427.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Often used when using MyBatis as the basic framework for database operations? The number is used as a placeholder, which causes manual replacement of parameters when troubleshooting problems, resulting in parameter replacement errors, parameter format matching errors, manual replacement efficiency and affecting the speed of problem detection.

Method used

Design a SQL statement processing method, which can obtain input information to be replaced and input information of special characters, call the replacement function to replace special characters, obtain the content of the text box in real time and copy it to the paste version based on the click event, improve the efficiency of SQL replacement.

Benefits of technology

It improves SQL replacement efficiency, improves the efficiency of production problem investigation, and solves the problems of parameter replacement errors and format matching errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202129A_ABST
    Figure CN119202129A_ABST
Patent Text Reader

Abstract

The invention discloses an SQL (Structured Query Language) statement processing method and device, equipment and a storage medium, firstly obtaining to-be-replaced input information of a first textbox and special character replacement input information of a second textbox, and then calling a replacement function to carry out replacement processing on corresponding special characters in the to-be-replaced input information and the special character replacement input information. At present, in the IT field, MyBatis serves as a basic framework of database operation and is often used, and the problem that in the prior art, MyBatis is often used is solved. Writing SQL statements with question marks as placeholders, and people need to manually check problems during troubleshooting. The technical problems of parameter replacement errors, parameter format matching errors, low manual replacement efficiency and influence on troubleshooting speed caused by replacement of the number (question mark) with the corresponding parameter in the prior art are solved. And therefore, the technical problem of low calculation efficiency of a mathematical model is solved.
Need to check novelty before this filing date? Find Prior Art

Claims

1. A method for processing SQL statements, characterized in that: include: Get the input information to be replaced in the first text box and the special character replacement input information in the second text box; The replacement function is called to perform replacement processing on the corresponding special characters in the input information to be replaced and the special character replacement input information.

2. The SQL statement processing method according to claim 1, characterized in that: Acquiring the input information to be replaced in the first text box and the special character replacement input information in the second text box specifically includes: Obtain the input information to be replaced in the first text box through querySelector; The special character replacement input information of the second text box is obtained through querySelector.

3. The SQL statement processing method according to claim 2, characterized in that: Before obtaining the input information to be replaced in the first text box and the special character replacement input information in the second text box, the following further includes: Adding input event listeners to the first text box and the second text box; The input event listener monitors the text input information of the first text box and the second text box.

4. The SQL statement processing method according to claim 3, characterized in that: Before calling the replacement function to replace the special characters corresponding to the input information to be replaced with the special character replacement input information, the method further includes: Monitor whether the first text box and the second text box have input out of focus; If so, the input event listener is triggered.

5. The SQL statement processing method according to claim 1, characterized in that: Calling the replacement function to replace the special characters corresponding to the input information to be replaced with the special character replacement input information specifically includes: Calling a replacement function to perform a loop traversal process on the input information to be replaced to determine the corresponding special character; The special character is replaced by the parameter value list and the special character replacement input information.

6. The SQL statement processing method according to claim 5, characterized in that: Calling the replacement function to loop through the input information to be replaced, and determining the corresponding special character, further includes: Performing array segmentation processing on the special character replacement input information; The parameter brackets of the special character replacement input information are deleted through the map method.

7. The SQL statement processing method according to claim 1, characterized in that: After calling the replacement function to replace the special characters corresponding to the input information to be replaced with the special character replacement input information, the method further includes: Performing a copy operation on the replacement information after the replacement process; Paste the replacement information after the copy operation and the corresponding first text box to generate a corresponding link operation.

8. A SQL statement processing device, characterized in that: include: An acquisition unit, used for acquiring the input information to be replaced in the first text box and the special character replacement input information in the second text box; The information replacement processing unit is used to call a replacement function to perform replacement processing on the corresponding special characters in the input information to be replaced and the special character replacement input information.

9. A SQL statement processing device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the SQL statement processing method according to any one of claims 1 to 7 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the SQL statement processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and system to process defaults in file format conversion process

    CN108197090A

  • Information processing method and device and storage medium

    CN110188366A

  • Method and device for preventing SQL injection, computer equipment and storage medium

    CN118568711A