Multilayer analysis method of structured query statement, computer equipment and storage medium
A technology of structured query and statement, applied in the field of information processing, can solve the problems of inability to realize data query, inconsistent SQL statement in database, etc.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0032] figure 2 This is a flowchart of the multi-layer parsing method for structured query statements provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of querying data in a logical database including multiple data sources, and the method can be performed by using The computer equipment can be used for database management. The computer equipment can be a server or a personal computer. The method specifically includes the following steps:
[0033] Step 110: Extract the operation table name according to the SQL statement.
[0034] The user edits the SQL statement according to the syntax of the SQL statement as required. The user can send a query request through the client to the server running the multi-layer parsing method for the structured query statement provided by the embodiment of the present invention, and the request carries the SQL statement edited by the user. After receiving the SQL statement, the server extracts the oper...
Embodiment 2
[0054] image 3 A flowchart of a method for multi-layer parsing of structured query statements provided in Embodiment 2 of the present invention, as a further description of the foregoing embodiments, includes:
[0055] Step 210: Extract the operation type according to the SQL statement.
[0056] The SQL statement can be identified, and the SQL statement extraction operation type can be identified by character matching. Exemplarily, starting from the starting string except the comment in the SQL statement, read the SQL statement in sequence, and match the read string with the preset operation type string. If the match is successful, the operation type represented by the matched operation type string is used as the operation type of the SQL statement.
[0057] Step 220: Determine whether the operation type matches the preset type.
[0058] The preset type may be an operation type included in a data manipulation language (Data Manipulation Language, DML). In the SQL statemen...
Embodiment 3
[0072] Figure 4 This is a flowchart of a method for multi-layer parsing of structured query statements provided in Embodiment 3 of the present invention. As a further description of the foregoing embodiments, this embodiment of the present invention adds a field parsing process on the basis of the foregoing embodiments, using It is used to extract the accessed table field information from the SQL statement, and perform table field permission verification. The method includes:
[0073] Step 310: Extract the operation table name according to the SQL statement.
[0074] Step 320: Read the preconfigured field permission variable.
[0075] The field permission variable is used as an environment variable when the logical database is running. It is a global variable, and the field permission variable can be dynamically configured.
[0076] The value of the field permission variable can be the first value or the second value. The first value may be "TRUE" and the second value may...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


