CN104731597A - Method for applying SQL statements to engineering software compiling platform - Google Patents
Method for applying SQL statements to engineering software compiling platform Download PDFInfo
- Publication number
- CN104731597A CN104731597A CN201510145287.1A CN201510145287A CN104731597A CN 104731597 A CN104731597 A CN 104731597A CN 201510145287 A CN201510145287 A CN 201510145287A CN 104731597 A CN104731597 A CN 104731597A
- Authority
- CN
- China
- Prior art keywords
- sql statement
- sql
- statement
- software development
- engineering software
- 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.)
- Pending
Links
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a method for applying SQL statements to an engineering software compiling platform. The method comprises the following steps that the SQL statements are generated; formats of the SQL statements are optimized; the SQL statements with the optimized formats are output; the SQL statements with the optimized formats are converted into statements of an engineering software development language identified by the engineering software compiling platform, wherein variable names and character string types applied to the engineering software development language are input; formats corresponding to the variable names and the character string types are mechanically used in the SQL statements with the optimized formats so as to generate the statements conforming to the norm of the engineering software development language. According to the method, the situation that a software engineer manually carries out complex statement conversion work can be avoided, and the error rate is reduced while the working efficiency is improved.
Description
Technical field
The present invention relates to areas of information technology, particularly a kind of method SQL statement being applied to engineering software editing platform.
Background technology
Along with the arrival of large data age, big or middle and small business takes up a large amount of enterprise personnel of maintenance data library management, production related data, so not only convenient management, backup but also easy record queries are thereupon a large amount of utilizations of enterprises engineering software.Most of engineering software need to combine with database realize data inquiry, renewal and analyzing and processing, but the usual employing of engineering software (as VS) is main software development language, and current most Relational DBMS, as Oracle, SQL Server, Access, MySQL etc. have employed sql like language (Structured Query Language, Structured Query Language (SQL)) standard, so just need the sql like language that database can identify to be converted to the software development language that engineering software editing platform can identify.
In prior art, manually database platform must be run successful a few row even SQL statement of tens row by software engineer and convert the language that engineering software editing platform can identify to, not only error rate is high, the burden of increase slip-stick artist in the work of such repetition, also affects overall work efficiency.
Summary of the invention
Fundamental purpose of the present invention aims to provide a kind of method that SQL statement can be applied to engineering software editing platform, to increase work efficiency.
For reaching above-mentioned purpose, the invention provides a kind of method SQL statement being applied to engineering software editing platform, comprising the following steps:
S1: generate SQL statement;
S2: form optimization is carried out to described SQL statement;
S3: the described SQL statement that output format is optimized;
S4: the statement described SQL statement of form optimization being converted to the Project Software Development language that described engineering software editing platform identifies, it comprises:
S41: input is applied to variable name and the character string type of described Project Software Development language;
S42: the form cover corresponding with described variable name and character string type is used for the described SQL statement of form optimization to generate the statement meeting described Project Software Development linguistic norm.
Preferably, in step S2 by each field branch of described SQL statement to carry out form optimization.
Preferably, step S42 comprises: the every a line identifying the described SQL statement through branch; The form cover corresponding with described variable name and character string type is used for every a line of the described SQL statement of form optimization to generate the statement meeting described Project Software Development linguistic norm.
Preferably, described Project Software Development language is C#, C or C++.
Preferably, step S1 comprises: the type choosing the database using sql like language; Be connected with the described Database chosen; Select the tables of data in this database; Select the data content in the type of SQL statement that needs to generate and this tables of data; And generate described SQL statement according to the type of selected data content and SQL statement.
Preferably, need the type of the SQL statement generated to be inquiry, upgrade, insert or delete.
Preferably, be connected with the described Database chosen by input database connection string.
The present invention realizes the application of SQL statement on engineering software editing platform by the statement of Project Software Development language that SQL statement is automatically converted to engineering software editing platform and identifies, thus avoid software engineer manually to carry out the complicated work of statement conversion, also reduce error rate while increasing work efficiency.
Accompanying drawing explanation
Fig. 1 shows process flow diagram SQL statement being applied to the method for engineering software editing platform of one embodiment of the invention;
Fig. 2 shows the process flow diagram of the automatic generation SQL statement of one embodiment of the invention;
Fig. 3 shows the example at the SQL statement switch user interface of one embodiment of the invention;
Fig. 4 shows the example of the SQL statement maker user interface of one embodiment of the invention.
Embodiment
For making content of the present invention clearly understandable, below in conjunction with Figure of description, content of the present invention is described further.Certain the present invention is not limited to this specific embodiment, and the general replacement known by those skilled in the art is also encompassed in protection scope of the present invention.
Method SQL statement being applied to engineering software editing platform of the present invention one specific embodiment is described below with reference to Fig. 1 ~ 2, and the method realizes by the SQL statement converter shown in Fig. 3 and Fig. 4 and SQL statement maker.
As shown in Figure 1, method SQL statement being applied to engineering software editing platform comprises the following steps:
Step S1, first generates SQL statement.
In this step, input by user is manual or generates SQL statement by the mode that the SQL statement maker shown in Fig. 4 generates automatically, this SQL statement need be run successfully through SQL database storehouse platform.
Step S2: form optimization is carried out to SQL statement;
Particularly, this step by each field branch of SQL statement to carry out form optimization, each field of SQL statement is come independent a line to beautify form, facilitates user to check.This form optimizational function is by the beautifier functional realiey of such as PL/SQL platform.
Step S3: the SQL statement that output format is optimized.
In this step, the SQL statement optimized can be exported, such as, be copied to the SQL converter shown in Fig. 3 through form.
Step S4: the statement SQL statement of form optimization being converted to the Project Software Development language that engineering software editing platform identifies.
In this step, the SQL statement of form optimization is carried out format conversion by instruction that SQL converter can respond user automatically.Particularly, SQL converter provides an operation interface, is applied to variable name and the character string type of Project Software Development language for user's input.Wherein, this project software development language need identify by engineering software editing platform, in the present embodiment, it can be C#, C or C++.For C# language, please refer to Fig. 3, provide C# in the lower end of operation interface
VariableName (C# variable name) and C#StringType (C# character string type) two options, user can customize C# variable name, and selects C#StringType as StringBulider or String according to drop-down menu.Next, user sends instruction by clicking " starting conversion " button, the SQL statement that the form cover corresponding with inputted variable name SQL and character string type Stringbuilder is optimized for form by SQL converter, thus generate the statement meeting Project Software Development language (C#) specification.In the present embodiment, each field due to the SQL statement of form optimization has all been carried out branch and has been optimized, and therefore, SQL converter can identify every a line of the SQL statement through branch, such as, by differentiating that line break is identified; And the form cover corresponding with variable name SQL and character string type Stringbuilder is used for the every a line of the SQL statement that form is optimized, namely the automatic SQL statement two ends in each field add double quotation marks and bracket, and add in front end " SQL Append ", thus generate as the statement meeting C# language specification in the latter half text box at Fig. 3 interface.
Preferably, in the present embodiment, SQL statement also generates automatically by SQL maker, manually inputs without the need to user.Next please refer to Fig. 2 and Fig. 4, step S1 generates SQL statement can comprise following sub-step further:
S11, chooses the type of the database using sql like language;
The option of type of database is provided in the operation interface of the SQL maker shown in Fig. 4, wherein can comprise current most Relational DBMS, as Oracle, SQL Server, Access, MySQL etc., user, by the type of database of drop-down menu choice for use sql like language, is oracle database as what select in the present embodiment.
S12, is connected with the Database chosen.
In this step, be connected with the Database chosen by input database connection string ConnectStr and SaveConStr on the operation interface of SQL maker, can subsequent step be carried out after prompting " successfully connects ".
S13, selects the tables of data in this database.
As a rule, store multiple tables of data in database, in this step, user by selecting form name to call the tables of data wanted in the database chosen on the operation interface of SQL maker.
S14, selects the data content in the type of SQL statement that needs to generate and this tables of data.
Wherein, need the type of the SQL statement generated to be inquiry, upgrade, insert or delete, user can select one in these SQL statement types as required, and the SQL statement type that will generate in the present embodiment is inquiry; Data content in tables of data is by obtaining the selection of data tabular field and/or condition limited field.As in the present embodiment, the operation interface of SQL maker provides InColumnName option for selecting the row of tables of data, provides OutColumnName option for selecting the screening conditions (the where statement corresponding to SQL) of data tabular.If all do not selected for InColumnName and OutColumnName, be then equal to the data content chosen in whole tables of data.
S15, the type according to selected data content and SQL statement generates SQL statement.
In this step, SQL maker response user instruction (clicking CreatCode button) is according to the data content selected and SQL statement type, and SQL statement create-rule generates SQL statement automatically.In the present embodiment, the variable in the WHERE statement querying condition of SQL can be represented with space.
Next, the statement that this SQL statement automatically generated is converted to the Project Software Development language that engineering software editing platform identifies by step S2 ~ S4, SQL converter can be proceeded.Wherein, SQL converter can identify the space that exists in where statement and it be applied mechanically to the form of C# language, and as automatically added two plus sige, double quotation marks and single quotation marks at two ends, space, the final C# statement formed is as shown in the text box of Fig. 4.
In sum, compared to prior art, the present invention realizes the application of SQL statement on engineering software editing platform by the statement of Project Software Development language that SQL statement is automatically converted to engineering software editing platform and identifies, not only greatly improves the work efficiency of PHP, reduces error rate that repeated work causes simultaneously by carrying out consistance and the standardization that form optimization also improves code to SQL statement.
Although the present invention discloses as above with preferred embodiment; right described many embodiments are citing for convenience of explanation only; and be not used to limit the present invention; those skilled in the art can do some changes and retouching without departing from the spirit and scope of the present invention, and the protection domain that the present invention advocates should be as the criterion with described in claims.
Claims (7)
1. SQL statement is applied to a method for engineering software editing platform, it is characterized in that, comprise the following steps:
S1: generate SQL statement;
S2: form optimization is carried out to described SQL statement;
S3: the described SQL statement that output format is optimized;
S4: the statement described SQL statement of form optimization being converted to the Project Software Development language that described engineering software editing platform identifies, it comprises:
S41: input is applied to variable name and the character string type of described Project Software Development language;
S42: the form cover corresponding with described variable name and character string type is used for the described SQL statement of form optimization to generate the statement meeting described Project Software Development linguistic norm.
2. method according to claim 1, is characterized in that, in step S2 by each field branch of described SQL statement to carry out form optimization.
3. method according to claim 2, is characterized in that, step S42 comprises:
Identify every a line of the described SQL statement through branch;
The form cover corresponding with described variable name and character string type is used for every a line of the described SQL statement of form optimization to generate the statement meeting described Project Software Development linguistic norm.
4. method according to claim 1, is characterized in that, described Project Software Development language is C#, C or C++.
5. method according to claim 1, is characterized in that, step S1 comprises:
Choose the type of the database using sql like language;
Be connected with the described Database chosen;
Select the tables of data in this database;
Select the data content in the type of SQL statement that needs to generate and this tables of data; And
Type according to selected data content and SQL statement generates described SQL statement.
6. method according to claim 5, is characterized in that, needs the type of the SQL statement generated to be inquiry, upgrades, inserts or delete.
7. method according to claim 1, is characterized in that, is connected with the described Database chosen by input database connection string.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510145287.1A CN104731597A (en) | 2015-03-30 | 2015-03-30 | Method for applying SQL statements to engineering software compiling platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510145287.1A CN104731597A (en) | 2015-03-30 | 2015-03-30 | Method for applying SQL statements to engineering software compiling platform |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104731597A true CN104731597A (en) | 2015-06-24 |
Family
ID=53455516
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510145287.1A Pending CN104731597A (en) | 2015-03-30 | 2015-03-30 | Method for applying SQL statements to engineering software compiling platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104731597A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106897104A (en) * | 2015-12-21 | 2017-06-27 | 宁波弘讯科技股份有限公司 | Program editing platform and program editing method |
CN109871372A (en) * | 2019-01-29 | 2019-06-11 | 公安部第一研究所 | A kind of method of combined data library tuning and program tuning |
CN110209395A (en) * | 2019-06-04 | 2019-09-06 | 沈阳欧瑞科技有限公司 | A kind of method, equipment and medium by SQL insertion high-level language |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102073490A (en) * | 2009-11-25 | 2011-05-25 | 阿里巴巴集团控股有限公司 | Method and device for translating database language |
CN103713887A (en) * | 2012-09-29 | 2014-04-09 | 镇江金软计算机科技有限责任公司 | Program code generator |
CN103914572A (en) * | 2014-04-29 | 2014-07-09 | 福建星网视易信息系统有限公司 | Database construction system, device and method |
-
2015
- 2015-03-30 CN CN201510145287.1A patent/CN104731597A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102073490A (en) * | 2009-11-25 | 2011-05-25 | 阿里巴巴集团控股有限公司 | Method and device for translating database language |
CN103713887A (en) * | 2012-09-29 | 2014-04-09 | 镇江金软计算机科技有限责任公司 | Program code generator |
CN103914572A (en) * | 2014-04-29 | 2014-07-09 | 福建星网视易信息系统有限公司 | Database construction system, device and method |
Non-Patent Citations (1)
Title |
---|
CONSOLT: ""c# sql语句的拼接怎么用"", 《HTTP://BBS.CSDN.NET/TOPICS/390867472》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106897104A (en) * | 2015-12-21 | 2017-06-27 | 宁波弘讯科技股份有限公司 | Program editing platform and program editing method |
CN106897104B (en) * | 2015-12-21 | 2020-04-07 | 宁波弘讯科技股份有限公司 | Program editing platform and program editing method |
CN109871372A (en) * | 2019-01-29 | 2019-06-11 | 公安部第一研究所 | A kind of method of combined data library tuning and program tuning |
CN109871372B (en) * | 2019-01-29 | 2021-01-19 | 公安部第一研究所 | Method for combining database tuning and program tuning |
CN110209395A (en) * | 2019-06-04 | 2019-09-06 | 沈阳欧瑞科技有限公司 | A kind of method, equipment and medium by SQL insertion high-level language |
CN110209395B (en) * | 2019-06-04 | 2023-05-16 | 沈阳欧瑞科技有限公司 | Method, equipment and medium for embedding SQL into high-level language |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10216826B2 (en) | Database query system | |
US20170357653A1 (en) | Unsupervised method for enriching rdf data sources from denormalized data | |
US10296505B2 (en) | Framework for joining datasets | |
CN105677323A (en) | Method for automatically generating database operation layer codes | |
US9928288B2 (en) | Automatic modeling of column and pivot table layout tabular data | |
CN104133772A (en) | Automatic test data generation method | |
CN104965735A (en) | Apparatus for generating upgrade SQL script | |
US20070073675A1 (en) | Database query translation | |
CN104793961A (en) | Quick JavaWeb development method and system using native Web codes | |
CN107103007B (en) | SQL code conversion method and device | |
CN109710631A (en) | Auxiliary generates method, apparatus, equipment and the computer storage medium of SQL code | |
CN109344374B (en) | Report generation method and device based on big data, electronic equipment and storage medium | |
US8862637B2 (en) | Generating data access operations based on a data model using a data services model | |
CN110750553A (en) | Method for self-defining export of data in service management system | |
CN104731597A (en) | Method for applying SQL statements to engineering software compiling platform | |
US7844601B2 (en) | Quality of service feedback for technology-neutral data reporting | |
US20220207033A1 (en) | Systems and methods for data retrieval | |
US10942732B1 (en) | Integration test framework | |
CN110308907B (en) | Data conversion method and device, storage medium and electronic equipment | |
CN115469849A (en) | Service processing system, method, electronic device and storage medium | |
US20130132425A1 (en) | Query definition apparatus and method for multi-tenant | |
CN113672626B (en) | Data structure changing method and device and electronic equipment | |
CN110716949A (en) | Method, device, medium and electronic equipment for automatically optimizing structured query statement | |
JP7269244B2 (en) | Systems and methods for providing globalization capabilities in service management application interfaces | |
CN112130841B (en) | SQL development method and device and terminal equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20150624 |