CN109710631A - Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code - Google Patents
Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code Download PDFInfo
- Publication number
- CN109710631A CN109710631A CN201810951211.1A CN201810951211A CN109710631A CN 109710631 A CN109710631 A CN 109710631A CN 201810951211 A CN201810951211 A CN 201810951211A CN 109710631 A CN109710631 A CN 109710631A
- Authority
- CN
- China
- Prior art keywords
- name
- code
- database table
- sql
- field name
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of methods that auxiliary generates SQL code, it include: when receiving the database table name of user's input, show the field name of the corresponding database table of the database table name, when detecting the selected operation triggered by the field name, SQL code is generated according to the SQL action statement that the corresponding field name of the selected operation and the user are selected, shows the SQL code of generation.The invention also discloses device, equipment and computer storage mediums that a kind of auxiliary generates SQL code.The present invention automatically generates SQL code by the field name and SQL action statement for the database table selected according to user, to solve the technical issues of being easy error during repeatedly inputting the SQL statement of some format complexity in the prior art.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of auxiliary to generate the method for SQL code, auxiliary generates
The device of SQL code, auxiliary generate the equipment and computer storage medium of SQL code.
Background technique
In database maintenance and development process, needs frequently to inquire table structure, type, field name, be frequently necessary to simultaneously
Some common SQL statements are repeatedly input, the format of especially some of SQL statements is more complicated, and repeated workload is mostly simultaneously
And it is easy error.
With the sharp increase of Database Systems scale and the expansion of software maintenance work requirements, traditional manually repeating is defeated
Inefficiency caused by the working method of the SQL statement of the entry format complexity and low problem of accuracy becomes increasingly conspicuous, it would be highly desirable to it solves,
And not yet occur automatically or semi-automatically generating the technology of SQL code according to the demand of user in the prior art.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill
Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of auxiliary to generate the method for SQL code, the dress of auxiliary generation SQL code
Set, assist the equipment and computer storage medium of generation SQL code, it is intended to which solution is repeatedly inputting some formats in the prior art
The technical issues of error is easy during complicated SQL statement.
To achieve the above object, the present invention provides a kind of method that auxiliary generates SQL code, and the auxiliary generates SQL generation
The method of code includes the following steps:
When receiving the database table name of user's input, the field of the corresponding database table of the database table name is shown
Name;
When detecting the selected operation triggered by the field name, according to the corresponding field of the selected operation
The SQL action statement that name and the user select generates SQL code;
Show the SQL code generated.
Preferably, described when detecting the selected operation triggered by the field name, according to the selected operation pair
SQL action statement that the field name and the user answered are selected generates the step of SQL code and includes:
Obtain the corresponding Code Template of SQL action statement that the user selectes, wherein the Code Template includes described
SQL action statement, database table name to be replaced and field name to be replaced;
The database table name to be replaced in the Code Template is replaced with to the database table name of user's input,
And the field name to be replaced is substituted for the field name, to generate SQL code.
Preferably, after the step of display SQL code further include:
When receiving the instruction of field assignment, the field name is shown, so that the user inputs the field name pair
The field value answered;
The field value that the user inputs is inserted into the SQL code.
Preferably, after the step of display SQL code further include:
When receiving the instruction of field assignment, the numerical value in assignment file is obtained;
The numerical value is inserted into the SQL code.
Preferably, described when receiving the database table name of user's input, show the corresponding number of the database table name
According to library table field name the step of before further include:
The list file of database is obtained according to configuration information;
The list file is parsed, to obtain database table name in the database and corresponding with the database table name
Field name;
The obtained database table name will be parsed and field name corresponding with the database table name is stored in the first number
According in table, wherein obtained from first tables of data when receiving the database table name of user's input and show the number
According to the corresponding field name of library table name.
Preferably, the database table name that parsing is obtained and field name corresponding with the database table name are deposited
Storage is after the step in the first tables of data further include:
The list file of timing acquisition database;
Parse the database table file, with obtain newest database table name in the database and with it is described newest
The corresponding field name of database table name;
It will the obtained newest database table name of parsing and field name corresponding with the newest database table name
It is stored in the second tables of data, and first tables of data is updated using second tables of data.
Preferably, the database table name that parsing is obtained and field name corresponding with the database table name are deposited
Storage is after the step in the first tables of data further include:
The list file of the newest database of timing acquisition;
The field name deleted in the list file of the newest database is determined, by the field name of the deletion from described
It is deleted in one tables of data;
It determines increased field name in the list file of the newest database, the increased field name is inserted into institute
It states in the first tables of data.
In addition, to achieve the above object, the present invention also provides the device that the auxiliary generates SQL code, which includes:
First display module, for showing the database table name pair when receiving the database table name of user's input
The field name for the database table answered;
Code generation module, for being selected according to described when detecting the selected operation triggered by the field name
It operates the corresponding field name and SQL action statement that the user selectes generates SQL code;
Second display module, for showing the SQL code generated.
In addition, to achieve the above object, the present invention also provides the equipment that the auxiliary generates SQL code, which includes:
Memory, processor and the place for assisting generating SQL code that is stored on the memory and can run on the processor
Program is managed, the processing routine that the auxiliary generates SQL code realizes that auxiliary as described above generates when being executed by the processor
The step of method of SQL code.
In addition, to achieve the above object, the present invention also proposes a kind of computer storage medium, which is characterized in that the meter
The processing routine that auxiliary generates SQL code is stored on calculation machine storage medium, the auxiliary generates the processing routine quilt of SQL code
The step of auxiliary as described above generates the method for SQL code is realized when processor executes.
A kind of auxiliary that the embodiment of the present invention proposes generates the method for SQL code, auxiliary generates SQL code device, auxiliary
SQL code equipment and computer storage medium are generated, when receiving the database table name of user's input, shows the database
The field name of the corresponding database table of table name, when detecting the selected operation triggered by the field name, according to the choosing
Surely it operates the corresponding field name and SQL action statement that the user selectes generates SQL code, show the described of generation
SQL code, the present invention automatically generate SQL code by the field name and SQL action statement for the database table selected according to user,
To solve the technical issues of being easy error during repeatedly inputting the SQL statement of some format complexity in the prior art.
Detailed description of the invention
Fig. 1 is the apparatus structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to;
Fig. 2 is the flow diagram that present invention auxiliary generates SQL method first embodiment;
Fig. 3 is the flow diagram that present invention auxiliary generates SQL method second embodiment;
Fig. 4 is the flow diagram that present invention auxiliary generates SQL method 3rd embodiment;
Fig. 5 is the functional block diagram that present invention auxiliary generates one embodiment of SQL device.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are: when receiving the database table name of user's input, described in display
The field name of the corresponding database table of database table name, when detecting the selected operation triggered by the field name, according to
The SQL action statement that the corresponding field name of the selected operation and the user select generates SQL code, shows generation
The SQL code.
Inefficiency caused by the working method of traditional SQL statement for manually repeatedly inputting format complexity and accuracy is low
The problem of become increasingly conspicuous, it would be highly desirable to solve, and in the prior art not yet occur can automatically or semi-automatically generate according to the demand of user
The technology of SQL code.
The present invention provides a solution, operates language by the field name and SQL for the database table selected according to user
Sentence automatically generates SQL code, to solve to be easy during repeatedly inputting the SQL statement of some format complexity in the prior art
The technical issues of error.
As shown in Figure 1, Fig. 1 is the apparatus structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
The terminal of that embodiment of the invention is the equipment that auxiliary generates SQL code.
As shown in Figure 1, the server that Fig. 1 is the hardware running environment that the embodiment of the present invention is related to (is called at event
Manage equipment, wherein event handling equipment can be to be made of individual event processing apparatus, is also possible to by other devices and thing
Part processing unit combines to be formed) structural schematic diagram.
Server of the embodiment of the present invention refers to a management resource and provides the computer of service for user, is generally divided into file
Server, database server and apps server.The computer or computer system for running the above software are also referred to as
Server.For common PC (personal computer) personal computer, server is in stability, safety, property
Energy etc. requires higher;As shown in Figure 1, the server may include: processor 1001, such as central processing unit
(Central Processing Unit, CPU), network interface 1004, user interface 1003, memory 1005, communication bus
1002, hardware such as chipset, disk system, network etc..Wherein, communication bus 1002 is for realizing the connection between these components
Communication.User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user
Interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include having for standard
Line interface, wireless interface (such as Wireless Fidelity WIreless-FIdelity, WIFI interface).Memory 1005 can be high speed with
Machine accesses memory (random access memory, RAM), is also possible to stable memory (non-volatile
), such as magnetic disk storage memory.Memory 1005 optionally can also be the storage dress independently of aforementioned processor 1001
It sets.
Optionally, server can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, sound
Frequency circuit, WiFi module;Input unit, than display screen, touch screen;Network interface can be blue in blanking wireless interface in addition to WiFi
Tooth, probe, 3G/4G/5G (digital representation of front be cellular mobile communication networks algebra.Which exactly indicate to be generation
Network.English alphabet G indicates generation) internet base station equipment etc..It will be understood by those skilled in the art that showing in Fig. 1
Server architecture out does not constitute the restriction to server, may include than illustrating more or fewer components, or combination
Certain components or different component layouts.
As shown in Figure 1, the computer software product, which is stored in a storage medium, (storage medium: is called computer storage
Medium, computer media, readable medium, readable storage medium storing program for executing, computer storage medium are directly medium etc., such as RAM, magnetic
Dish, CD) in, including some instructions are used so that terminal device (it can be mobile phone, computer, server, air conditioner,
Or network equipment etc.) execute method described in each embodiment of the present invention, the memory as a kind of computer storage medium
It may include operating system, network communication module, Subscriber Interface Module SIM and computer program in 1005.
In server shown in Fig. 1, network interface 1004 be mainly used for connect background data base, with background data base into
Row data communication;User interface 1003 is mainly used for connection client, and (client, is called user terminal or terminal, and the present invention is implemented
Example terminal can be also possible to mobile terminal, details are not described herein with fixed terminal), data communication is carried out with client;And it handles
Device 1001 can be used for calling the computer program stored in memory 1005, and execute the thing that following embodiment of the present invention provides
Step in part processing method.
Referring to Fig. 2, first embodiment of the invention provides a kind of method that auxiliary generates SQL code, which comprises
Step S10 shows the corresponding database of the database table name when receiving the database table name of user's input
The field name of table.
The code that SQL code is made of structured query language, for the access of database data, inquiry and other pipes
Reason operation.Specifically, it needs to be determined that the field name for the database to be operated, the number that can be inputted according to user in SQL code
It is determined according to library table name.When receiving the database table name of user's input, corresponding database is found according to database table name
List file obtains field name and display in corresponding database by parsing database table file, carries out for user further
Selection.
Step S20, it is corresponding according to the selected operation when detecting the selected operation triggered by the field name
The SQL action statement that the field name and the user select generates SQL code.
After user has selected aiming field name in the field name of the database table of display, it is also necessary to select corresponding SQL
Action statement.SQL action statement is the keyword in common basic function corresponding SQL statement, such as selection function
Select, the insert of insertions function, update of more new function etc..
After having obtained the aiming field name and SQL action statement that user selectes, the basic process of SQL code is generated are as follows:
Obtain the corresponding Code Template of SQL action statement selected of user, wherein Code Template includes SQL action statement, to be replaced
Database table name to be replaced in Code Template is replaced with the data of user's input by database table name and field name to be replaced
Library table name, and field name to be replaced is substituted for the aiming field name that user selectes, to generate SQL code.
Such as when the SQL action statement that user selectes is that " database table of " UPDATE ", user's input are entitled
" REPORT.AITBB04 ", the aiming field that user selectes is entitled " CBAL ", the SQL action statement selected according to user
It is " UPDATE#TableName SET#Column=() WHERE " that " UPDATE ", which finds corresponding Code Template,.By code
Database table name to be replaced and field name to be replaced in template replace with the database table name and use of user's input respectively
The SQL code generated after the selected aiming field name in family is " UPDATE REPORT.AITBB04SET CBAL=()
WHERE"".It should be noted that need the SQL code based on the generation to continue perfect by user, can just bear finally executable
SQL code, need to carry out it is perfect include in the bracket of above-mentioned code insert field assignment, and above-mentioned code most
Corresponding execution condition is inserted after WHERR words and expressions afterwards.
Further, in order to meet the use demand and different usage scenarios of different user, it can receive user's definition
The corresponding Code Template of SQL action statement of property.It should be noted that user needs to be followed and preset code according to prompt
The personalized corresponding Code Template of SQL action statement of the same rule definition of template, rule includes to be replaced in Code Template
Content need preposition No. #, the content further edited to user double bracket identifies etc..
Step S30 shows the SQL code of generation.
The SQL code that the field name selected according to user and SQL action statement generate is shown that user can select
And the code for replicating display is further edited to target position, is replicated again after can also editing to the code of display
It uses.
Next it is specifically described with the tool for realizing that auxiliary generates SQL code method provided by the present embodiment.
Tool provides interactive interface, and there are three the interactive interfaces, and main region is data list structure display area, automatically generates
Code display area and self-service editing area additionally include that SQL action statement selects drop-down list, database Title input frame
Drop-down menu etc. is selected with tables of data.
Data list structure display area for showing chosen data list structure content, including in tables of data field name and
Corresponding field type.Automatic code generating display area is for showing that SQL operates the corresponding code automatically generated, the code
In comprising SQL action statement keyword, operation field name etc..Self-service editing area is for editing the code automatically generated, with shape
At final available complete SQL code.
The step of user generates SQL code using tool auxiliary are as follows:
1, user first inputs the database name to be quoted in database Title input frame, is then including the database institute
The data table name to be quoted is selected in the tables of data selection drop-down menu for having data table name, data list structure display area is aobvious at this time
Show the information of the data packet, including field name and field type in tables of data.
2, user selects SQL action statement in SQL action statement selection drop-down list, and shows in data list structure
The regional choice field to be operated is shown according to the code that the SQL action statement and operation field of selection automatically generate at this time
In automatic code generating display area, while the field name selected is replicated automatically and can directly paste use.
3, user clicks the Code copying that " obtaining result " button on interactive interface will automatically generate in last step
To self-service editing area, supplement improves the part being short of in automatic code generating.
4, user can be by the complete Code copying shown in self-service editing area to other any need codes
Software in, such as Code Edit software and database control interface etc..
Further, tool interactive interface further includes code format setting area, when tool receives user in code lattice
When the instruction for the setting code format that formula setting area issues, be displayed on SQL code in automatic code display area according to
Code format in instruction is configured and shows.Wherein, settable format includes branch's Formatting Output or not in lines
Output etc..
Further, when user data list structure display area select the field to be operated when, can once select more
It is corresponding at this time to generate multistage SQL code when a field name, wherein multistage SQL code includes the SQL operation language that user selectes
Sentence.
In the present embodiment, it is automatically generated by the field name for the database table selected according to user and SQL action statement
SQL code, to solve the technology for being easy error during repeatedly inputting the SQL statement of some format complexity in the prior art
Problem.
Further, referring to Fig. 3, second embodiment of the invention is based on first embodiment and provides a kind of auxiliary generation SQL generation
The method of code, the present embodiment is after step S30 further include:
Step S40 shows the field name when receiving the instruction of field assignment, for described in user input
The corresponding field value of field name.
Some SQL action statement need to carry out one by one to multiple specified fields when being inserted into new data to tables of data
Assignment realizes the simplification to user's assignment operation at this time with visualized operation interface.Such as user needs to tables of data
REPORT.AITBB04 insertion new data in, need for field " AC, CCY, CCAL " field distinguish assignment " hyguy, guyg,
iuhiu".User first selects SQL action statement for insert sentence, then selected " AC, CCY, CCAL " field, then click tools
Interactive interface on " Insert value " button, will pop up an interface at this time, on the interface of pop-up with list display it
Preceding " AC, CCY, CCAL " field selected by user, each guild show the field name of a chosen field, field type and
These three regions of field value, user, to the assignment of the field, confirm errorless rear click " confirmation " in the corresponding input in field value region
Button can show the SQL statement code of the field assignment comprising input are as follows: INSERT INFO in self-service editing area
REPORT.AITBB04(AC,CCY,CCAL)VALUES(‘hyguy’,‘guyg’,‘iuhiu’)。
The field value that the user inputs is inserted into the SQL code by step S50.
Further, tool can be supported to import the mode of file, carry out batch to multiple fields of table simultaneously to realize
The operation of input value obtains the numerical value in assignment file, the numerical value is inserted into that is, when receiving the instruction of field assignment
In the SQL code, specifically includes the following steps:
" importing file " button is clicked on the interface of click " Insert value " pop-up, selects file to be imported,
It wherein, include multiple numerical value in file to be imported;
After filesselected, clicks confirmation and import file;
Tool is analyzed and is handled to file is imported: when importing in file only includes multiple numerical value, by the suitable of numerical value
Each numerical value is assigned to each field in table by sequence;When importing in file includes field name and corresponding value, in table
Matched field name carries out assignment.
In the present embodiment, by the way that field name to be shown to and received the assignment of user's input, user is simplified to database
The operation of field name assignment, improves efficiency.
Further, referring to Fig. 4, third embodiment of the invention is based on first embodiment and provides a kind of auxiliary generation SQL generation
The method of code, the present embodiment is before step S10 further include:
Step S60 obtains the list file of database according to configuration information.
Configuration information includes database name and corresponding connection type.When being communicated according to configuration information with Database
After connection, the list file of database can be obtained by the access to database.
Step S70 parses the list file, with obtain database table name in the database and with the database table
The corresponding field name of name.
Step S80, the database table name and field name corresponding with the database table name that parsing is obtained store
In the first tables of data, wherein obtain and show from first tables of data when receiving the database table name of user's input
Show the corresponding field name of the database table name.
Further, tool in use, when having update with the associated database table file of the first tables of data,
Tool needs to update the first tables of data according to the database table file of update.Specifically, tool can be with timing acquisition database
List file, parse the database table file of update, with obtain newest database table name in database and with newest number
According to the corresponding field name of library table name, and will the obtained newest database table name of parsing and corresponding with newest database table name
Field name is stored in the second tables of data, updates first tables of data using the second tables of data.
Further, when causing the expense parsed completely very big when database table Documents Comparison is big, in order to improve work
Has efficiency, tool is in list file of the timing acquisition to newest database, in the list file that can determine newest database
The field name of deletion deletes the field name of deletion from the first tables of data, while in the list file of determining newest database
Increased field name is inserted into first tables of data by increased field name.In the list file for obtaining newest database
There are many modes for deletion and increased field name: can increase monitoring module in the database, being responsible for monitoring is currently made by tool
The modification record of database table file, modification record include increase and delete it is automatic, tool real-time reception update repair
Change record;Or more newest database table file and out-of-date database table file, increment only is carried out to the part of variation
Parsing, finds to delete and increased field name with this, wherein field name relevant character string in identification database list file
On the basis of carry out new and old database table file comparison and increment parsing.
In the present embodiment, by the way that the list file of database, the number for obtaining parsing are obtained and parsed according to configuration information
It is stored in the first tables of data according to the field name of library list file, ensure that when receiving the database table name of user's input, lead to
The field name of database table file can rapidly be shown by crossing the first tables of data of access.
The present invention also provides the device that a kind of auxiliary generates SQL code, which includes:
First display module 10, for showing the database table name when receiving the database table name of user's input
The field name of corresponding database table;
Code generation module 20, for when detecting the selected operation triggered by the field name, according to the choosing
Surely it operates the corresponding field name and SQL action statement that the user selectes generates SQL code;
Second display module 30, for showing the SQL code generated.
Optionally, the code generation module 20 includes:
Acquiring unit, the corresponding Code Template of SQL action statement selected for obtaining the user, wherein the generation
Code mask includes the SQL action statement, database table name to be replaced and field name to be replaced;
Replacement unit is inputted for the database table name to be replaced in the Code Template to be replaced with the user
Database table name, and the field name to be replaced is substituted for the field name, to generate SQL code.
Optionally, the auxiliary generates SQL code device further include:
Third display module, for showing the field name when receiving the instruction of field assignment, for the user
Input the corresponding field value of the field name;
The code generation module 20 is also used to for the field value that the user inputs being inserted into the SQL code.
Optionally, the auxiliary generates SQL code device further include:
Module is obtained, for obtaining the numerical value in assignment file when receiving the instruction of field assignment;
The code generation module 20 is also used to for the numerical value being inserted into the SQL code.
Optionally, the auxiliary generates SQL code device further include:
Module is obtained, for obtaining the list file of database according to configuration information;
Parsing module, for parsing the list file, with obtain database table name in the database and with the number
According to the corresponding field name of library table name;
Memory module, for the obtained database table name and field name corresponding with the database table name will to be parsed
It is stored in the first tables of data, wherein obtained from first tables of data when receiving the database table name of user's input
And show the corresponding field name of the database table name.
Optionally, the auxiliary generates SQL code device further include:
Obtain module, the list file for timing acquisition database;
Parsing module, for parsing the database table file, to obtain the newest database table in the database
Name and field name corresponding with the newest database table name;
Memory module, for will parse the obtained newest database table name and with the newest database table name
Corresponding field name is stored in the second tables of data, and updates first tables of data using second tables of data.
Optionally, the auxiliary generates SQL code device further include:
Obtain module, the list file for the newest database of timing acquisition;
Tables of data maintenance module, the field name deleted in the list file for determining the newest database will be described
The field name of deletion is deleted from first tables of data;
Tables of data maintenance module is also used to determine increased field name in the list file of the newest database, will be described
Increased field name is inserted into first tables of data.
The present invention also provides a kind of equipment that auxiliary generates SQL code, which includes: memory, processor and storage
On the memory and the auxiliary that can run on the processor generates SQL code processing routine, the auxiliary generation SQL
The step of auxiliary generates the method for SQL code is realized when code process program is executed by the processor.
In addition, the embodiment of the present invention also proposes a kind of computer storage medium, it is stored in the computer storage medium
Auxiliary generates the processing routine of SQL code, when the processing routine that the auxiliary generates SQL code is executed by processor described in realization
Auxiliary generate SQL code method the step of.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone,
Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of method that auxiliary generates SQL code, which is characterized in that the method that the auxiliary generates SQL code includes following
Step:
When receiving the database table name of user's input, the field name of the corresponding database table of the database table name is shown;
When detecting the selected operation triggered by the field name, according to the corresponding field name of the selected operation and
The SQL action statement that the user selectes generates SQL code;
Show the SQL code generated.
2. the method that auxiliary as described in claim 1 generates SQL code, which is characterized in that described to detect by described
When the selected operation of field name triggering, grasped according to the SQL that the corresponding field name of the selected operation and the user are selected
Making the step of sentence generates SQL code includes:
Obtain the corresponding Code Template of SQL action statement that the user selectes, wherein the Code Template includes the SQL
Action statement, database table name to be replaced and field name to be replaced;
The database table name to be replaced in the Code Template is replaced with to the database table name of user's input, and will
The field name to be replaced is substituted for the field name, to generate SQL code.
3. the method that auxiliary as described in claim 1 generates SQL code, which is characterized in that the display SQL code
After step further include:
When receiving the instruction of field assignment, the field name is shown, so that the user input field name is corresponding
Field value;
The field value that the user inputs is inserted into the SQL code.
4. the method that auxiliary as described in claim 1 generates SQL code, which is characterized in that the display SQL code
After step further include:
When receiving the instruction of field assignment, the numerical value in assignment file is obtained;
The numerical value is inserted into the SQL code.
5. the method that auxiliary as described in claim 1 generates SQL code, which is characterized in that described to receive user's input
Database table name when, before the step of showing the field name of the corresponding database table of the database table name further include:
The list file of database is obtained according to configuration information;
The list file is parsed, to obtain database table name and the field corresponding with the database table name in the database
Name;
The obtained database table name will be parsed and field name corresponding with the database table name is stored in the first tables of data
In, wherein it is obtained from first tables of data when receiving the database table name of user's input and shows the database
The corresponding field name of table name.
6. the method that auxiliary as claimed in claim 5 generates SQL code, which is characterized in that it is described will be described in parsing obtains
After the step that database table name and field name corresponding with the database table name are stored in the first tables of data further include:
The list file of timing acquisition database;
Parse the database table file, with obtain newest database table name in the database and with the newest number
According to the corresponding field name of library table name;
The obtained newest database table name of parsing and field name corresponding with the newest database table name are stored
First tables of data is updated in the second tables of data, and using second tables of data.
7. the method that auxiliary as claimed in claim 5 generates SQL code, which is characterized in that it is described will be described in parsing obtains
After the step that database table name and field name corresponding with the database table name are stored in the first tables of data further include:
The list file of the newest database of timing acquisition;
It determines the field name deleted in the list file of the newest database, the field name of the deletion is counted from described first
According to being deleted in table;
It determines increased field name in the list file of the newest database, the increased field name is inserted into described
In one tables of data.
8. the device that a kind of auxiliary generates SQL code, which is characterized in that described device includes:
First display module, for showing that the database table name is corresponding when receiving the database table name of user's input
The field name of database table;
Code generation module, for when detecting the selected operation triggered by the field name, according to the selected operation
The SQL action statement that the corresponding field name and the user select generates SQL code;
Second display module, for showing the SQL code generated.
9. a kind of equipment that auxiliary generates SQL code, which is characterized in that the equipment includes: memory, processor and is stored in
On the memory and the auxiliary that can run on the processor generates the processing routine of SQL code, auxiliary generation SQL
Realize that the auxiliary as described in any one of claims 1 to 7 generates SQL generation when the processing routine of code is executed by the processor
The step of method of code.
10. a kind of computer storage medium, which is characterized in that be stored with auxiliary in the computer storage medium and generate SQL generation
The processing routine of code, the processing routine that the auxiliary generates SQL code are realized when being executed by processor as in claim 1 to 7
The step of described in any item auxiliary generate the method for SQL code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810951211.1A CN109710631A (en) | 2018-08-17 | 2018-08-17 | Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810951211.1A CN109710631A (en) | 2018-08-17 | 2018-08-17 | Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109710631A true CN109710631A (en) | 2019-05-03 |
Family
ID=66253819
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810951211.1A Withdrawn CN109710631A (en) | 2018-08-17 | 2018-08-17 | Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109710631A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795101A (en) * | 2019-09-18 | 2020-02-14 | 平安科技(深圳)有限公司 | SQL code information display method and device, computer device and storage medium |
CN112000661A (en) * | 2020-07-19 | 2020-11-27 | 浪潮电子信息产业股份有限公司 | Rapid generation method and system for table structure context |
CN112799659A (en) * | 2021-01-12 | 2021-05-14 | 杨飞 | Method, device and terminal for automatically generating data interface without programming |
CN112860725A (en) * | 2021-02-02 | 2021-05-28 | 浙江大华技术股份有限公司 | SQL automatic generation method and device, storage medium and electronic equipment |
CN113157672A (en) * | 2021-05-17 | 2021-07-23 | 中国银行股份有限公司 | Method and device for modifying SQLServer database fields in batch |
CN113626050A (en) * | 2021-07-22 | 2021-11-09 | 北京金山云网络技术有限公司 | Updating method and device of medical application, electronic equipment and storage medium |
CN114089976A (en) * | 2022-01-21 | 2022-02-25 | 通联支付网络服务股份有限公司 | Method, apparatus, and medium for generating database operation statements |
-
2018
- 2018-08-17 CN CN201810951211.1A patent/CN109710631A/en not_active Withdrawn
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795101A (en) * | 2019-09-18 | 2020-02-14 | 平安科技(深圳)有限公司 | SQL code information display method and device, computer device and storage medium |
CN110795101B (en) * | 2019-09-18 | 2024-01-30 | 平安科技(深圳)有限公司 | SQL code information display method, device, computer device and storage medium |
CN112000661A (en) * | 2020-07-19 | 2020-11-27 | 浪潮电子信息产业股份有限公司 | Rapid generation method and system for table structure context |
CN112000661B (en) * | 2020-07-19 | 2022-06-21 | 浪潮电子信息产业股份有限公司 | Rapid generation method and system for table structure context |
CN112799659A (en) * | 2021-01-12 | 2021-05-14 | 杨飞 | Method, device and terminal for automatically generating data interface without programming |
CN112860725A (en) * | 2021-02-02 | 2021-05-28 | 浙江大华技术股份有限公司 | SQL automatic generation method and device, storage medium and electronic equipment |
CN113157672A (en) * | 2021-05-17 | 2021-07-23 | 中国银行股份有限公司 | Method and device for modifying SQLServer database fields in batch |
CN113157672B (en) * | 2021-05-17 | 2024-01-19 | 中国银行股份有限公司 | Batch modification method and device for SQLServer database fields |
CN113626050A (en) * | 2021-07-22 | 2021-11-09 | 北京金山云网络技术有限公司 | Updating method and device of medical application, electronic equipment and storage medium |
CN113626050B (en) * | 2021-07-22 | 2024-06-04 | 北京金山云网络技术有限公司 | Medical application updating method and device, electronic equipment and storage medium |
CN114089976A (en) * | 2022-01-21 | 2022-02-25 | 通联支付网络服务股份有限公司 | Method, apparatus, and medium for generating database operation statements |
CN114089976B (en) * | 2022-01-21 | 2022-04-26 | 通联支付网络服务股份有限公司 | Method, apparatus, and medium for generating database operation statements |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109710631A (en) | Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code | |
CN106598612B (en) | Operation method and system for data table in database | |
CN111708804B (en) | Data processing method, device, equipment and medium | |
CN111666326A (en) | ETL scheduling method and device | |
US8417690B2 (en) | Automatically avoiding unconstrained cartesian product joins | |
CN110968601A (en) | Data query processing method and device | |
CN110427188B (en) | Configuration method, device, equipment and storage medium of single-test assertion program | |
CN108762743A (en) | Data table operation code generation method and device | |
CN107506383B (en) | Audit data processing method and computer equipment | |
CN108197091B (en) | Method, system and related equipment for creating data table | |
CN111209309A (en) | Method, device and equipment for determining processing result of data flow graph and storage medium | |
CN110781183B (en) | Processing method and device for incremental data in Hive database and computer equipment | |
CN108664665A (en) | Data format method for transformation, device, equipment and readable storage medium storing program for executing | |
CN110597896A (en) | Data display method, data display device and terminal equipment | |
CN110198327B (en) | Data transmission method and related equipment | |
US20120221320A1 (en) | Translation support apparatus, translation delivery period setting method, and storage medium | |
JP5651050B2 (en) | Data generation apparatus and data generation program | |
CN115688715A (en) | Report generation method and device and computer readable medium | |
CN112540760A (en) | UI (user interface) quick construction method based on data source field | |
CN113157904A (en) | Sensitive word filtering method and system based on DFA algorithm | |
CN114647735A (en) | Relation graph display method, medium and display device | |
CN116431517A (en) | Intelligent keyword prompting method and device for automatic test platform | |
CN111159207A (en) | Information processing method and device | |
CN104731597A (en) | Method for applying SQL statements to engineering software compiling platform | |
CN115469849A (en) | Service processing system, method, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190503 |
|
WW01 | Invention patent application withdrawn after publication |