WO2019000698A1 - 生成sql语句的方法、***、电子装置及可读存储介质 - Google Patents

生成sql语句的方法、***、电子装置及可读存储介质 Download PDF

Info

Publication number
WO2019000698A1
WO2019000698A1 PCT/CN2017/105019 CN2017105019W WO2019000698A1 WO 2019000698 A1 WO2019000698 A1 WO 2019000698A1 CN 2017105019 W CN2017105019 W CN 2017105019W WO 2019000698 A1 WO2019000698 A1 WO 2019000698A1
Authority
WO
WIPO (PCT)
Prior art keywords
sql statement
statement
generating
dml
generate
Prior art date
Application number
PCT/CN2017/105019
Other languages
English (en)
French (fr)
Inventor
沈毅
张勋
王刚
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019000698A1 publication Critical patent/WO2019000698A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2448Query languages for particular applications; for extensibility, e.g. user defined types
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method, system, electronic device, and readable storage medium for generating a SQL statement.
  • SQL statements are generally written by developers manually. In addition to careful understanding of business logic knowledge and professional SQL knowledge, they also face SQL statements that are not standardized, do not conform to business logic, are error-prone and efficient. Low problem.
  • the main object of the present invention is to provide a method, system, electronic device and readable storage medium for generating SQL statements, which are intended to automatically and accurately generate SQL statements.
  • a first aspect of the present application provides an electronic device, where the electronic device includes a storage device and a processing device, where the storage device stores a system for generating a SQL statement that can be run on the processing device.
  • the system that generates the SQL statement is executed by the processing device to implement the following steps:
  • A. Receive a SQL statement generation instruction sent by the user, generate and display a SQL statement generation type selection interface, and the SQL statement generation type includes a general SQL statement and a customized SQL statement;
  • the user receives an instruction to generate a customized SQL statement based on the SQL statement generation type selection interface, generate and display a function change selection interface, and after receiving the change function selected by the user based on the function change selection interface According to the preset function change item and the mapping relationship of the SQL statement block, the SQL statement block corresponding to the selected change function is determined.
  • the second aspect of the present application provides a method for generating an SQL statement, which is applied to an electronic device, and the method includes:
  • A. Receive a SQL statement generation instruction sent by the user, generate and display a SQL statement generation type selection interface, and the SQL statement generation type includes a general SQL statement and a customized SQL statement;
  • the instruction of the statement generates and displays a DDL statement parameter setting interface, and after receiving basic information input by the user based on the DDL statement parameter setting interface, generates a DDL statement according to the basic information;
  • the user receives an instruction to generate a customized SQL statement based on the SQL statement generation type selection interface, generate and display a function change selection interface, and after receiving the change function selected by the user based on the function change selection interface According to the preset function change item and the mapping relationship of the SQL statement block, the SQL statement block corresponding to the selected change function is determined.
  • a third aspect of the present application provides a system for generating a SQL statement, where the system for generating a SQL statement includes:
  • the display module is configured to receive a SQL statement generation instruction sent by the user, generate and display a SQL statement generation type selection interface, and the SQL statement generation type includes a general SQL statement and a customized SQL statement;
  • a first generating module configured to: if the user receives an instruction to generate a general SQL statement based on the SQL statement generation type selection interface, generate and display a DDL statement parameter setting interface, and set the parameter based on the DDL statement parameter received by the user After the basic information is input by the interface, the DDL statement is generated according to the basic information;
  • a second generating module configured to: when the user receives an instruction to generate a customized SQL statement based on the SQL statement generation type selection interface, generate and display a function change selection interface, and select a selection interface based on the function change received by the user After the selected change function is performed, the mapping relationship between the item and the SQL statement block is changed according to the preset function, and the SQL statement block corresponding to the selected change function is determined.
  • a fourth aspect of the present application provides a computer readable storage medium having stored thereon at least one computer readable instruction executable by a processing device to:
  • the DDL statement parameter setting interface is generated and displayed, and after receiving the basic information input by the user based on the DDL statement parameter setting interface, Generating a DDL statement based on the basic information;
  • the function change selection interface is generated and displayed, and after receiving the change function selected by the user based on the function change selection interface, according to The mapping relationship between the preset function change item and the SQL statement block determines the SQL statement block corresponding to the selected change function.
  • the method, the system, the electronic device and the readable storage medium for generating a SQL statement according to the present invention generate a type selection interface for displaying a general SQL statement or a customized SQL statement according to a requirement by displaying a SQL statement; if the user selects to generate a general SQL statement , the DDL statement parameter setting interface is provided for the user to input the basic information required to construct the table to generate the DDL statement; if the customized SQL statement is selected, the user selects the function item to be changed, and generates a customized SQL statement block.
  • the corresponding parameter setting interface is provided, and the corresponding SQL statement is automatically generated according to the parameters input by the user and the preset template, thereby realizing automatic and accurate Generate SQL statements.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a system 10 for generating a SQL statement according to the present invention
  • FIG. 2 is a schematic diagram of functional modules of an embodiment of a system for generating a SQL statement according to the present invention
  • FIG. 3 is a schematic diagram of functional modules of another embodiment of a system for generating a SQL statement according to the present invention.
  • FIG. 4 is a schematic flow chart of an embodiment of a method for generating a SQL statement according to the present invention.
  • FIG. 5 is a schematic flowchart diagram of another embodiment of a method for generating a SQL statement according to the present invention.
  • FIG. 1 is a schematic diagram of an operating environment of a preferred embodiment of a system 10 for generating SQL statements according to the present invention.
  • the system 10 for generating the SQL statement is installed and runs in the electronic device 1.
  • the electronic device 1 may include, but is not limited to, a storage device 11, a processing device 12, and a display 13.
  • Figure 1 shows only the electronic device 1 with components 11-13, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the storage device 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type storage device (eg, an SD or DX storage device, etc.), a random access storage device (RAM), static random access memory device (SRAM), read only memory device (ROM), electrically erasable programmable read only memory device (EEPROM), programmable read only memory device (PROM), magnetic storage device, disk, CD, etc.
  • the storage device 11 may be an internal storage unit of the electronic device 1, such as a hard disk or a memory of the electronic device 1.
  • the storage device 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC), and security. Digital (Secure Digital, SD) card, flash card (Flash Card), etc. Further, the storage device 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the storage device 11 is configured to store application software and various types of data installed in the electronic device 1, such as the program code of the system 10 for generating the SQL statement.
  • the storage device 11 can also be used to temporarily store data that has been output or is about to be output.
  • the processing device 12 may be a central processing unit (CPU), a micro processing device or other data processing chip for running program code or processing data stored in the storage device 11, For example, executing the system that generates the SQL statement 10 and so on.
  • CPU central processing unit
  • micro processing device or other data processing chip for running program code or processing data stored in the storage device 11, For example, executing the system that generates the SQL statement 10 and so on.
  • the display 13 in some embodiments may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display 13 is used to display information processed in the electronic device 1 and a user interface for displaying visualization, such as a SQL statement generation type selection interface for the user to select, a parameter setting interface for the user to input parameters, and the like.
  • the components 11-13 of the electronic device 1 communicate with one another via a system bus.
  • FIG. 2 is a functional block diagram of an embodiment of a system 10 for generating SQL statements according to the present invention.
  • the system 10 for generating an SQL statement may be divided into one or more modules, the one or more modules being stored in the storage device 11 and being processed by one or more processing devices. (This embodiment is performed by the processing device 12) to complete the present invention.
  • the system 10 for generating a SQL statement may be divided into a display module 01, a first generation module 02, and a second generation module 03.
  • module refers to a series of computer program instruction segments capable of performing a particular function, and is more suitable than the program for describing the execution of the system 10 for generating SQL statements in the electronic device 1. The following description will specifically describe the functions of the display module 01, the first generation module 02, and the second generation module 03.
  • the display module 01 is configured to receive a SQL statement generation instruction sent by the user, generate and display a SQL statement generation type selection interface, and the SQL statement generation type includes a general SQL statement and a customized SQL statement.
  • the SQL statement generation type selection interface is generated and displayed, and the SQL statement generation type selection interface may provide a pull-down, check or Click and other methods for the user to choose to generate a general SQL statement or a customized SQL statement according to the needs of the actual application.
  • the general SQL statement may include a more general-purpose SQL statement such as a built-in table, and the customized SQL statement may include a personalized SQL statement such as a function of changing a specific item in some tables.
  • the first generating module 02 is configured to: if the user receives an instruction to generate a general SQL statement based on the SQL statement generation type selection interface, generate and display a DDL statement parameter setting interface, and receive the user based on the DDL statement parameter After setting the basic information input by the interface, a DDL statement is generated based on the basic information.
  • DDL data definition language
  • the main commands are CREATE, ALTER, DROP, etc.
  • DDL is mainly used to define or change the structure of the table (TABLE). Initialization work such as data types, links between tables, and constraints are mostly used when creating tables. Generally, when adding a certain function in the system, you need to create a table first.
  • the structure and data type of the table are basically the same, but the basic information of different tables, such as the parameters required to create the table according to the functional requirements (basic table) Name, column name, user name, etc.) are different. Therefore, when determining that the user needs to generate a generic SQL statement, Then generate and display the DDL statement parameter setting interface for the user to input basic information such as table name, column name, and user name. Further, the user may also input basic information related to the built-in table, such as synonyms, authorization, and indexing constraints, in the DDL statement parameter setting interface. After receiving the basic information input by the user based on the parameter setting interface of the DDL statement, the basic information input by the user is imported into a predetermined DDL template, and the structure, data type, etc.
  • the basic information input by the user such as the table name, column name, and user name, is imported into the corresponding position in the DDL template, and a complete DDL statement can be generated. That is, when it is necessary to generate the SQL statement required to build the table, the user can automatically generate a complicated table statement block (DDL statement) by inputting the parameter information without manually writing a large amount of SQL statement code.
  • DDL statement complicated table statement block
  • the second generation module 03 is configured to: if the user receives an instruction to generate a customized SQL statement based on the SQL statement generation type selection interface, generate and display a function change selection interface, and select a user based on the function change selection After the interface selection function is changed, the mapping relationship between the item and the SQL statement block is determined according to the preset function, and the SQL statement block corresponding to the selected change function is determined.
  • a function change selection interface is generated and displayed. Due to the different functional operations of the tables in the system, it is necessary to generate a dedicated SQL that conforms to the system logic, that is, customized SQL. For example, the addition and deletion of some functions in the system requires a series of SQL statement blocks to be executed in a certain order. Therefore, if the user needs to add or delete some functions in the system, it is necessary to generate a customized SQL statement. After the user selects the change function in the function change selection interface, the user can change the item and the SQL statement block according to the preset function.
  • the mapping relationship determines the SQL statement block corresponding to the selected change function. For example, for the addition, deletion or change of functions, the SQL statement block corresponding to different function change items is predetermined, and the user only needs to select the required function change item to find the function change item corresponding to the selected function change item. SQL statement block.
  • the customized SQL statement block that the user needs to generate is a DML statement block executed in a preset order
  • the DML (data manipulation language) is a data operation language for processing data in the SQL, including SELECT ( Query), UPDATE (update), INSERT (add), DELETE (delete), etc.
  • SELECT Query
  • UPDATE update
  • INSERT add
  • DELETE delete
  • the SQL statement generation type selection interface is displayed for the user to select to generate a general SQL statement or a customized SQL statement according to the need; if the user selects to generate a general SQL statement, the DDL statement parameter setting interface is provided for the user to input the basic requirements for building the table. Information to generate DDL statements; if you choose to generate custom SQL statements, the user can select the function items to be changed and generate customized SQL statement blocks.
  • the corresponding parameter setting interface is provided, and the corresponding SQL statement is automatically generated according to the parameters input by the user and the preset template, so that the SQL statement is automatically and accurately generated.
  • another embodiment of the present invention provides a system for generating a SQL statement. Based on the foregoing embodiments, the method further includes:
  • a third generation module 04 configured to generate a corresponding DML template according to the DDL statement; generate and display a DML statement parameter setting interface, and after receiving the DML data parameter input by the user based on the DML statement parameter setting interface, The DML data parameters are imported into the DML template to generate corresponding DML statements.
  • the DDL statement can be used to construct the table.
  • the data operation function in the established table needs to be limited, such as addition, update, deletion, and the like.
  • the corresponding DML template is further generated according to a preset manner, and a DML statement parameter setting interface is generated and displayed, so that the user can correspondingly define the data operation function in the table, for example, the specified in the table can be specified. Some cells can be added, some cells can be updated, and so on.
  • the DML data parameter is imported into the DML template to generate a corresponding DML statement. It is more practical to implement automatic generation of DML statements.
  • the invention further provides a method of generating a SQL statement.
  • FIG. 4 is a schematic flowchart diagram of an embodiment of a method for generating a SQL statement according to the present invention.
  • the method for generating a SQL statement includes:
  • Step S10 Receive a SQL statement generation instruction sent by the user, generate and display a SQL statement generation type selection interface, and the SQL statement generation type includes a general SQL statement and a customized SQL statement.
  • the SQL statement generation type selection interface is generated and displayed, and the SQL statement generation type selection interface may provide a pull-down, check or Click and other methods for the user to choose to generate a general SQL statement or a customized SQL statement according to the needs of the actual application.
  • the general SQL statement may include a more general-purpose SQL statement such as a built-in table, and the customized SQL statement may include a personalized SQL statement such as a function of changing a specific item in some tables.
  • Step S20 If the user receives an instruction to generate a general SQL statement based on the SQL statement generation type selection interface, generate and display a DDL statement parameter setting interface, and receive the basic input of the user based on the DDL statement parameter setting interface. After the information, a DDL statement is generated based on the basic information.
  • DDL data definition language
  • the main commands are CREATE, ALTER, DROP, etc.
  • DDL is mainly used to define or change the structure of the table (TABLE). Initialization work such as data types, links between tables, and constraints are mostly used when creating tables. Generally added in the system When adding a certain function, you need to create a table first.
  • the structure and data type of the created table are basically the same, but the basic information of different tables, such as the parameters required for the functional requirements when creating the table (basic table name, column name) , user name, etc.) is different. Therefore, when it is determined that the user needs to generate a general SQL statement, the DDL statement parameter setting interface is generated and displayed for the user to input basic information such as a table name, a column name, and a user name. Further, the user may also input basic information related to the built-in table, such as synonyms, authorization, and indexing constraints, in the DDL statement parameter setting interface.
  • the basic information input by the user After receiving the basic information input by the user based on the parameter setting interface of the DDL statement, the basic information input by the user is imported into a predetermined DDL template, and the structure, data type, etc. of the table are defined in the DDL template.
  • the basic information input by the user such as the table name, column name, and user name, is imported into the corresponding position in the DDL template, and a complete DDL statement can be generated. That is, when it is necessary to generate the SQL statement required to build the table, the user can automatically generate a complicated table statement block (DDL statement) by inputting the parameter information without manually writing a large amount of SQL statement code.
  • DDL statement complicated table statement block
  • Step S30 if the user receives an instruction to generate a customized SQL statement based on the SQL statement generation type selection interface, generates and displays a function change selection interface, and receives a change function selected by the user based on the function change selection interface. After that, according to the preset function change item and the SQL statement block mapping relationship, the SQL statement block corresponding to the selected change function is determined.
  • a function change selection interface is generated and displayed. Due to the different functional operations of the tables in the system, it is necessary to generate a dedicated SQL that conforms to the system logic, that is, customized SQL. For example, the addition and deletion of some functions in the system requires a series of SQL statement blocks to be executed in a certain order. Therefore, if the user needs to add or delete some functions in the system, it is necessary to generate a customized SQL statement. After the user selects the change function in the function change selection interface, the user can change the item and the SQL statement block according to the preset function.
  • the mapping relationship determines the SQL statement block corresponding to the selected change function. For example, for the addition, deletion or change of functions, the SQL statement block corresponding to different function change items is predetermined, and the user only needs to select the required function change item to find the function change item corresponding to the selected function change item. SQL statement block.
  • the customized SQL statement block that the user needs to generate is a DML statement block executed in a preset order
  • the DML (data manipulation language) is a data operation language for processing data in the SQL, including SELECT ( Query), UPDATE (update), INSERT (add), DELETE (delete), etc.
  • SELECT Query
  • UPDATE update
  • INSERT add
  • DELETE delete
  • the SQL statement generation type selection interface is displayed for the user to select to generate a general SQL statement or a customized SQL statement according to the need; if the user selects to generate a general SQL statement, the DDL statement parameter setting interface is provided for the user to input the basic requirements for building the table. Information to generate DDL statements; if you choose to generate custom SQL statements, the user can select the function items to be changed and generate customizations. SQL statement block. According to the different types of requirements generated by the user, the corresponding parameter setting interface is provided, and the corresponding SQL statement is automatically generated according to the parameters input by the user and the preset template, so that the SQL statement is automatically and accurately generated.
  • another embodiment of the present invention provides a method for generating a SQL statement.
  • the method further includes:
  • Step S40 generating a corresponding DML template according to the DDL statement; generating and displaying a DML statement parameter setting interface, and importing the DML data parameter after receiving the DML data parameter input by the user based on the DML statement parameter setting interface Describe the DML template and generate the corresponding DML statement.
  • the DDL statement can be used to construct the table.
  • the data operation function in the established table needs to be limited, such as addition, update, deletion, and the like.
  • the corresponding DML template is further generated according to a preset manner, and a DML statement parameter setting interface is generated and displayed, so that the user can correspondingly define the data operation function in the table, for example, the specified in the table can be specified. Some cells can be added, some cells can be updated, and so on.
  • the DML data parameter is imported into the DML template to generate a corresponding DML statement. It is more practical to implement automatic generation of DML statements.
  • the present invention also provides a computer readable storage medium storing a system for generating a SQL statement, the system for generating a SQL statement executable by at least one processing device to cause the at least one
  • the processing device performs the steps of the method for generating the SQL statement in the foregoing embodiment, and the specific implementation processes of the steps S10, S20, and S30 of the method for generating the SQL statement are as described above, and are not described herein again.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM, including a number of instructions to make a terminal device (can be a mobile phone, a computer, A server, an air conditioner, or a network device, etc.) performs the methods described in various embodiments of the present invention.
  • a storage medium such as ROM/RAM, disk, CD-ROM, including a number of instructions to make a terminal device (can be a mobile phone, a computer, A server, an air conditioner, or a network device, etc.) performs the methods described in various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

一种生成SQL语句的方法、***、电子装置及可读存储介质,实现了自动准确地生成SQL语句,该方法包括:接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面;若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。

Description

生成SQL语句的方法、***、电子装置及可读存储介质
优先权申明
本申请基于巴黎公约申明享有2017年6月25日递交的申请号为CN201710490412.1、名称为“生成SQL语句的方法、电子装置及可读存储介质”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本发明涉及计算机技术领域,尤其涉及一种生成SQL语句的方法、***、电子装置及可读存储介质。
背景技术
在现有的***开发中,SQL语句一般都是由开发人员手工编写,除了需要仔细了解业务逻辑知识、专业SQL知识外还面临自己写的SQL语句不合规范、不符合业务逻辑、容易出错且效率低下的问题。
发明内容
本发明的主要目的在于提供一种生成SQL语句的方法、***、电子装置及可读存储介质,旨在自动准确地生成SQL语句。
为实现上述目的,本申请第一方面提供一种电子装置,所述电子装置包括存储设备、处理设备,所述存储设备上存储有可在所述处理设备上运行的生成SQL语句的***,所述生成SQL语句的***被所述处理设备执行时实现如下步骤:
A、接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句;
B、若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;
C、若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
本申请第二方面提供一种生成SQL语句的方法,应用于电子装置,所述方法包括:
A、接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句;
B、若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL 语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;
C、若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
本申请第三方面提供一种生成SQL语句的***,所述生成SQL语句的***包括:
显示模块,用于接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句;
第一生成模块,用于若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;
第二生成模块,用于若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
本申请第四方面提供一种计算机可读存储介质,其上存储有至少一个可被处理设备执行以实现以下操作的计算机可读指令:
接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句;
若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;
若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
本发明提出的生成SQL语句的方法、***、电子装置及可读存储介质,通过显示SQL语句生成类型选择界面供用户根据需要选择生成通用SQL语句或定制化SQL语句;若用户选择生成通用SQL语句,则提供DDL语句参数设置界面供用户输入建表所需的基本信息,以生成DDL语句;若选择生成定制化SQL语句,则供用户选择需更改的功能项,并生成定制化的SQL语句块。能根据用户生成SQL语句的不同类型需求,提供相应的参数设置界面,并根据用户输入的参数及预设的模板自动生成相应的SQL语句,实现自动准确地 生成SQL语句。
附图说明
图1为本发明生成SQL语句的***10较佳实施例的运行环境示意图;
图2为本发明生成SQL语句的***一实施例的功能模块示意图;
图3为本发明生成SQL语句的***另一实施例的功能模块示意图;
图4为本发明生成SQL语句的方法一实施例的流程示意图;
图5为本发明生成SQL语句的方法另一实施例的流程示意图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
为了使本发明所要解决的技术问题、技术方案及有益效果更加清楚、明白,以下结合附图和实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
本发明提供一种生成SQL语句的***。请参阅图1,是本发明生成SQL语句的***10较佳实施例的运行环境示意图。
在本实施例中,所述的生成SQL语句的***10安装并运行于电子装置1中。该电子装置1可包括,但不仅限于,存储设备11、处理设备12及显示器13。图1仅示出了具有组件11-13的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
所述存储设备11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储设备(例如,SD或DX存储设备等)、随机访问存储设备(RAM)、静态随机访问存储设备(SRAM)、只读存储设备(ROM)、电可擦除可编程只读存储设备(EEPROM)、可编程只读存储设备(PROM)、磁性存储设备、磁盘、光盘等。在一些实施例中,所述存储设备11可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘或内存。所述存储设备11在另一些实施例中也可以是所述电子装置1的外部存储设备,例如所述电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储设备11还可以既包括所述电子装置1的内部存储单元也包括外部存储设备。所述存储设备11用于存储安装于所述电子装置1的应用软件及各类数据,例如所述生成SQL语句的***10的程序代码等。所述存储设备11还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理设备12在一些实施例中可以是一中央处理设备(Central Processing Unit,CPU),微处理设备或其他数据处理芯片,用于运行所述存储设备11中存储的程序代码或处理数据,例如执行所述生成SQL语句的*** 10等。
所述显示器13在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。所述显示器13用于显示在所述电子装置1中处理的信息以及用于显示可视化的用户界面,例如供用户选择的SQL语句生成类型选择界面、供用户输入参数的参数设置界面等。所述电子装置1的部件11-13通过***总线相互通信。
请参阅图2,是本发明生成SQL语句的***10一实施例的功能模块图。在本实施例中,所述的生成SQL语句的***10可以被分割成一个或多个模块,所述一个或者多个模块被存储于所述存储设备11中,并由一个或多个处理设备(本实施例为所述处理设备12)所执行,以完成本发明。例如,在图2中,所述的生成SQL语句的***10可以被分割成显示模块01、第一生成模块02及第二生成模块03。本发明所称的模块是指能够完成特定功能的一系列计算机程序指令段,比程序更适合于描述所述生成SQL语句的***10在所述电子装置1中的执行过程。以下描述将具体介绍所述显示模块01、第一生成模块02及第二生成模块03的功能。
显示模块01,用于接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句。
本实施例中,在接收到用户通过浏览器、APP客户端等发送的SQL语句生成指令后,生成并显示SQL语句生成类型选择界面,该SQL语句生成类型选择界面中可提供下拉、勾选或点击等方式供用户根据实际应用的需要选择生成通用SQL语句或定制化SQL语句。该通用SQL语句可以包括如建表等通用程度较高的SQL语句,定制化SQL语句可以包括如对某些表中特定项的功能进行更改的个性化SQL语句等。
第一生成模块02,用于若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句。
若用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句,如通过下拉、勾选或点击等方式选择生成通用SQL语句,则生成并显示DDL语句参数设置界面。DDL(data definition language)为数据定义语言,用于定义和管理SQL数据库中的所有对象的语言,主要的命令有CREATE、ALTER、DROP等,DDL主要是用在定义或改变表(TABLE)的结构,数据类型,表之间的链接和约束等初始化工作上,大多在建立表时使用。一般在***中增加某项功能时,均需先建立表格,由于建立表格的结构、数据类型等都大致一样,只是不同表格的基本信息如创建表时根据功能需求所需的参数(基本的表名、列名、用户名等)不同。因此,在确定用户需生成通用SQL语句时, 则生成并显示DDL语句参数设置界面,以供用户输入表名、列名、用户名等基本信息。进一步地,用户还可在DDL语句参数设置界面中输入同义词、授权、建立索引约束等与建表相关的基本信息。在收到用户基于所述DDL语句参数设置界面输入的基本信息后,将用户输入的基本信息导入预先确定好的DDL模板,该DDL模板中已限定好建立表格的结构、数据类型等,只需将用户输入的基本信息如表名、列名、用户名等导入该DDL模板中相应的位置,即可生成完整的DDL语句。即在需要生成建表所需的SQL语句时,用户只需输入参数信息,即可自动生成一个很复杂的建表语句块(DDL语句),而无需用户人工写出大量的SQL语句代码。
第二生成模块03,用于若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
若用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句,如通过下拉、勾选或点击等方式选择生成定制化SQL语句,则生成并显示功能更改选择界面。由于针对***中表格的不同功能操作,需要生成符合***逻辑的专属SQL即定制化SQL,例如***中有些功能的增删改需要一连串的SQL语句块按照某种顺序执行。因此,若用户需要进行***中有些功能的增删改,则需要生成定制化SQL语句,用户在所述功能更改选择界面选择了更改功能后,即可根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。例如,针对功能的增加、删除或更改,预先确定好与不同功能更改项相对应的SQL语句块,用户只需选择其所需的功能更改项,即可找到与其选择的功能更改项相对应的SQL语句块。
在一种实施方式中,用户需要生成的定制化SQL语句块为按预设顺序执行的DML语句块,DML(data manipulation language)为数据操作语言,用于SQL中处理数据等操作,包括SELECT(查询)、UPDATE(更新)、INSERT(添加)、DELETE(删除)等,可预先确定好与不同功能更改项如表格中某一项需更改的功能相对应的DML语句块,用户只需选择其所需的功能更改项,即可找到与其选择的功能更改项相对应的按预设顺序执行的DML语句块,以实现其功能更改。
本实施例通过显示SQL语句生成类型选择界面供用户根据需要选择生成通用SQL语句或定制化SQL语句;若用户选择生成通用SQL语句,则提供DDL语句参数设置界面供用户输入建表所需的基本信息,以生成DDL语句;若选择生成定制化SQL语句,则供用户选择需更改的功能项,并生成定制化的SQL语句块。能根据用户生成SQL语句的不同类型需求,提供相应的参数设置界面,并根据用户输入的参数及预设的模板自动生成相应的SQL语句,实现自动准确地生成SQL语句。
如图3所示,本发明另一实施例提出一种生成SQL语句的***,在上述实施例的基础上,还包括:
第三生成模块04,用于根据所述DDL语句生成对应的DML模板;生成并显示DML语句参数设置界面,在收到用户基于所述DML语句参数设置界面输入的DML数据参数后,将所述DML数据参数导入所述DML模板,生成相应的DML语句。
本实施例中,在用户选择生成通用SQL语句,进而生成建表所需的DDL语句后,即可利用该DDL语句进行建表。进一步地,一般情况下,还需对建立的表格中的数据操作功能进行限定,如可添加、更新、删除等进行限定。则可根据生成的DDL语句按预设方式进一步生成得到对应的DML模板,生成并显示DML语句参数设置界面,以供用户对表格中的数据操作功能进行相应的限定,如可设定表格中指定部分单元格可添加,指定部分单元格可更新,等等。在收到用户基于所述DML语句参数设置界面输入的DML数据参数后,将所述DML数据参数导入所述DML模板,即可生成相应的DML语句。实现DML语句的自动生成,更加实用。
本发明进一步提供一种生成SQL语句的方法。
参照图4,图4为本发明生成SQL语句的方法一实施例的流程示意图。
在一实施例中,该生成SQL语句的方法包括:
步骤S10,接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句。
本实施例中,在接收到用户通过浏览器、APP客户端等发送的SQL语句生成指令后,生成并显示SQL语句生成类型选择界面,该SQL语句生成类型选择界面中可提供下拉、勾选或点击等方式供用户根据实际应用的需要选择生成通用SQL语句或定制化SQL语句。该通用SQL语句可以包括如建表等通用程度较高的SQL语句,定制化SQL语句可以包括如对某些表中特定项的功能进行更改的个性化SQL语句等。
步骤S20,若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句。
若用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句,如通过下拉、勾选或点击等方式选择生成通用SQL语句,则生成并显示DDL语句参数设置界面。DDL(data definition language)为数据定义语言,用于定义和管理SQL数据库中的所有对象的语言,主要的命令有CREATE、ALTER、DROP等,DDL主要是用在定义或改变表(TABLE)的结构,数据类型,表之间的链接和约束等初始化工作上,大多在建立表时使用。一般在***中增 加某项功能时,均需先建立表格,由于建立表格的结构、数据类型等都大致一样,只是不同表格的基本信息如创建表时根据功能需求所需的参数(基本的表名、列名、用户名等)不同。因此,在确定用户需生成通用SQL语句时,则生成并显示DDL语句参数设置界面,以供用户输入表名、列名、用户名等基本信息。进一步地,用户还可在DDL语句参数设置界面中输入同义词、授权、建立索引约束等与建表相关的基本信息。在收到用户基于所述DDL语句参数设置界面输入的基本信息后,将用户输入的基本信息导入预先确定好的DDL模板,该DDL模板中已限定好建立表格的结构、数据类型等,只需将用户输入的基本信息如表名、列名、用户名等导入该DDL模板中相应的位置,即可生成完整的DDL语句。即在需要生成建表所需的SQL语句时,用户只需输入参数信息,即可自动生成一个很复杂的建表语句块(DDL语句),而无需用户人工写出大量的SQL语句代码。
步骤S30,若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
若用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句,如通过下拉、勾选或点击等方式选择生成定制化SQL语句,则生成并显示功能更改选择界面。由于针对***中表格的不同功能操作,需要生成符合***逻辑的专属SQL即定制化SQL,例如***中有些功能的增删改需要一连串的SQL语句块按照某种顺序执行。因此,若用户需要进行***中有些功能的增删改,则需要生成定制化SQL语句,用户在所述功能更改选择界面选择了更改功能后,即可根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。例如,针对功能的增加、删除或更改,预先确定好与不同功能更改项相对应的SQL语句块,用户只需选择其所需的功能更改项,即可找到与其选择的功能更改项相对应的SQL语句块。
在一种实施方式中,用户需要生成的定制化SQL语句块为按预设顺序执行的DML语句块,DML(data manipulation language)为数据操作语言,用于SQL中处理数据等操作,包括SELECT(查询)、UPDATE(更新)、INSERT(添加)、DELETE(删除)等,可预先确定好与不同功能更改项如表格中某一项需更改的功能相对应的DML语句块,用户只需选择其所需的功能更改项,即可找到与其选择的功能更改项相对应的按预设顺序执行的DML语句块,以实现其功能更改。
本实施例通过显示SQL语句生成类型选择界面供用户根据需要选择生成通用SQL语句或定制化SQL语句;若用户选择生成通用SQL语句,则提供DDL语句参数设置界面供用户输入建表所需的基本信息,以生成DDL语句;若选择生成定制化SQL语句,则供用户选择需更改的功能项,并生成定制化 的SQL语句块。能根据用户生成SQL语句的不同类型需求,提供相应的参数设置界面,并根据用户输入的参数及预设的模板自动生成相应的SQL语句,实现自动准确地生成SQL语句。
如图5所示,本发明另一实施例提出一种生成SQL语句的方法,在上述实施例的基础上,在步骤S20之后还包括:
步骤S40,根据所述DDL语句生成对应的DML模板;生成并显示DML语句参数设置界面,在收到用户基于所述DML语句参数设置界面输入的DML数据参数后,将所述DML数据参数导入所述DML模板,生成相应的DML语句。
本实施例中,在用户选择生成通用SQL语句,进而生成建表所需的DDL语句后,即可利用该DDL语句进行建表。进一步地,一般情况下,还需对建立的表格中的数据操作功能进行限定,如可添加、更新、删除等进行限定。则可根据生成的DDL语句按预设方式进一步生成得到对应的DML模板,生成并显示DML语句参数设置界面,以供用户对表格中的数据操作功能进行相应的限定,如可设定表格中指定部分单元格可添加,指定部分单元格可更新,等等。在收到用户基于所述DML语句参数设置界面输入的DML数据参数后,将所述DML数据参数导入所述DML模板,即可生成相应的DML语句。实现DML语句的自动生成,更加实用。
此外,本发明还提供一种计算机可读存储介质,所述计算机可读存储介质存储有生成SQL语句的***,所述生成SQL语句的***可被至少一个处理设备执行,以使所述至少一个处理设备执行如上述实施例中的生成SQL语句的方法的步骤,该生成SQL语句的方法的步骤S10、S20、S30等具体实施过程如上文所述,在此不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件来实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机, 服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。
以上参照附图说明了本发明的优选实施例,并非因此局限本发明的权利范围。上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。另外,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本领域技术人员不脱离本发明的范围和实质,可以有多种变型方案实现本发明,比如作为一个实施例的特征可用于另一实施例而得到又一实施例。凡在运用本发明的技术构思之内所作的任何修改、等同替换和改进,均应在本发明的权利范围之内。

Claims (20)

  1. 一种电子装置,其特征在于,所述电子装置包括存储设备、处理设备,所述存储设备上存储有可在所述处理设备上运行的生成SQL语句的***,所述生成SQL语句的***被所述处理设备执行时实现如下步骤:
    A、接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句;
    B、若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;
    C、若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
  2. 如权利要求1所述的电子装置,其特征在于,所述根据该基本信息生成DDL语句的步骤包括:
    将该基本信息导入预先确定的DDL模板,生成相应的DDL语句。
  3. 如权利要求1或2所述的电子装置,其特征在于,在所述步骤B之后,所述处理设备还用于执行所述生成SQL语句的***,以实现以下步骤:
    根据所述DDL语句生成对应的DML模板;生成并显示DML语句参数设置界面,在收到用户基于所述DML语句参数设置界面输入的DML数据参数后,将所述DML数据参数导入所述DML模板,生成相应的DML语句。
  4. 如权利要求1或2所述的电子装置,其特征在于,所述功能更改选择界面中可选择的功能更改项包括一个或多个预设功能的增加、删改,所述SQL语句块为按预设顺序执行的DML语句块。
  5. 如权利要求1或2所述的电子装置,其特征在于,所述基本信息包括表名、列名、用户名。
  6. 一种生成SQL语句的方法,应用于电子装置,其特征在于,所述方法包括:
    A、接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句;
    B、若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;
    C、若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
  7. 如权利要求6所述的生成SQL语句的方法,其特征在于,所述根据该基本信息生成DDL语句的步骤包括:
    将该基本信息导入预先确定的DDL模板,生成相应的DDL语句。
  8. 如权利要求6或7所述的生成SQL语句的方法,其特征在于,在所述步骤B之后,还包括:
    根据所述DDL语句生成对应的DML模板;生成并显示DML语句参数设置界面,在收到用户基于所述DML语句参数设置界面输入的DML数据参数后,将所述DML数据参数导入所述DML模板,生成相应的DML语句。
  9. 如权利要求6或7所述的生成SQL语句的方法,其特征在于,所述功能更改选择界面中可选择的功能更改项包括一个或多个预设功能的增加、删改,所述SQL语句块为按预设顺序执行的DML语句块。
  10. 如权利要求6或7所述的生成SQL语句的方法,其特征在于,所述基本信息包括表名、列名、用户名。
  11. 一种生成SQL语句的***,其特征在于,所述生成SQL语句的***包括:
    显示模块,用于接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句;
    第一生成模块,用于若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;
    第二生成模块,用于若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
  12. 如权利要求11所述的生成SQL语句的***,其特征在于,所述第一生成模块还用于:
    将该基本信息导入预先确定的DDL模板,生成相应的DDL语句。
  13. 如权利要求11或12所述的生成SQL语句的***,其特征在于,还包括:
    第三生成模块,用于根据所述DDL语句生成对应的DML模板;生成并显示DML语句参数设置界面,在收到用户基于所述DML语句参数设置界面输入的DML数据参数后,将所述DML数据参数导入所述DML模板,生成相应的DML语句。
  14. 如权利要求11或12所述的生成SQL语句的***,其特征在于,所述功能更改选择界面中可选择的功能更改项包括一个或多个预设功能的增加、删改,所述SQL语句块为按预设顺序执行的DML语句块。
  15. 如权利要求11或12所述的生成SQL语句的***,其特征在于,所述基本信息包括表名、列名、用户名。
  16. 一种计算机可读存储介质,其上存储有至少一个可被处理设备执行以实现以下操作的计算机可读指令:
    接收用户发送的SQL语句生成指令,生成并显示SQL语句生成类型选择界面,SQL语句生成类型包括通用SQL语句和定制化SQL语句;
    若收到用户基于所述SQL语句生成类型选择界面选择生成通用SQL语句的指令,则生成并显示DDL语句参数设置界面,并在收到用户基于所述DDL语句参数设置界面输入的基本信息后,根据该基本信息生成DDL语句;
    若收到用户基于所述SQL语句生成类型选择界面选择生成定制化SQL语句的指令,则生成并显示功能更改选择界面,并在收到用户基于所述功能更改选择界面选择的更改功能后,根据预设的功能更改项与SQL语句块的映射关系,确定选择的更改功能对应的SQL语句块。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述根据该基本信息生成DDL语句包括:
    将该基本信息导入预先确定的DDL模板,生成相应的DDL语句。
  18. 如权利要求16或17所述的计算机可读存储介质,其特征在于,还包括:
    根据所述DDL语句生成对应的DML模板;生成并显示DML语句参数设置界面,在收到用户基于所述DML语句参数设置界面输入的DML数据参数后,将所述DML数据参数导入所述DML模板,生成相应的DML语句。
  19. 如权利要求16或17所述的计算机可读存储介质,其特征在于,所述功能更改选择界面中可选择的功能更改项包括一个或多个预设功能的增加、 删改,所述SQL语句块为按预设顺序执行的DML语句块。
  20. 如权利要求16或17所述的计算机可读存储介质,其特征在于,所述基本信息包括表名、列名、用户名。
PCT/CN2017/105019 2017-06-25 2017-09-30 生成sql语句的方法、***、电子装置及可读存储介质 WO2019000698A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710490412.1A CN107679056B (zh) 2017-06-25 2017-06-25 生成sql语句的方法、电子装置及可读存储介质
CN201710490412.1 2017-06-25

Publications (1)

Publication Number Publication Date
WO2019000698A1 true WO2019000698A1 (zh) 2019-01-03

Family

ID=61134154

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/105019 WO2019000698A1 (zh) 2017-06-25 2017-09-30 生成sql语句的方法、***、电子装置及可读存储介质

Country Status (2)

Country Link
CN (1) CN107679056B (zh)
WO (1) WO2019000698A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131846A (zh) * 2020-09-07 2020-12-25 北京思特奇信息技术股份有限公司 一种基于映射关系进行传参的方法及***、电子装置、存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446218A (zh) * 2018-09-25 2019-03-08 中国平安人寿保险股份有限公司 Sql语句生成方法、装置及计算机可读存储介质
CN109783551A (zh) * 2019-01-08 2019-05-21 上海上湖信息技术有限公司 数据展示方法及***、可读存储介质
CN110083617B (zh) * 2019-05-05 2021-06-01 上海达梦数据库有限公司 一种ddl语句的处理方法、装置、电子设备和介质
CN110928544A (zh) * 2019-11-11 2020-03-27 浙江大搜车软件技术有限公司 程序块生成方法、装置、计算机设备和存储介质
CN113448980A (zh) * 2021-06-18 2021-09-28 青岛海尔科技有限公司 用于生成sql语句的方法及装置、电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425090A (zh) * 2008-12-08 2009-05-06 浪潮通信信息***有限公司 一种数据汇总智能sql语句的生成方法
CN101673287A (zh) * 2009-10-16 2010-03-17 金蝶软件(中国)有限公司 一种sql语句生成方法及***
US20150088913A1 (en) * 2013-09-26 2015-03-26 International Business Machines Corporation Determining Criticality of a SQL Statement
CN106407246A (zh) * 2016-07-22 2017-02-15 平安科技(深圳)有限公司 Sql执行计划管理的方法及装置
CN106776962A (zh) * 2016-12-05 2017-05-31 济南浪潮高新科技投资发展有限公司 一种通用的Excel数据导入多个数据库物理表方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876893A (zh) * 2009-04-28 2010-11-03 上海亿客网络科技有限公司 Web项目代码自动生成的方法
CN103136263A (zh) * 2011-11-23 2013-06-05 英业达股份有限公司 自动生成sql语句的方法
CN103093000A (zh) * 2013-02-25 2013-05-08 用友软件股份有限公司 数据库查询建模***和数据库查询建模方法
US9911001B2 (en) * 2015-06-12 2018-03-06 Pearson Education, Inc. Automatic SQL query modification for data restriction
CN105446743A (zh) * 2015-12-12 2016-03-30 天津南大通用数据技术股份有限公司 一种自动生成sql语句的***及方法
CN106775770B (zh) * 2017-01-16 2020-08-11 兴唐通信科技有限公司 基于类信息构建查询语句的查找方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425090A (zh) * 2008-12-08 2009-05-06 浪潮通信信息***有限公司 一种数据汇总智能sql语句的生成方法
CN101673287A (zh) * 2009-10-16 2010-03-17 金蝶软件(中国)有限公司 一种sql语句生成方法及***
US20150088913A1 (en) * 2013-09-26 2015-03-26 International Business Machines Corporation Determining Criticality of a SQL Statement
CN106407246A (zh) * 2016-07-22 2017-02-15 平安科技(深圳)有限公司 Sql执行计划管理的方法及装置
CN106776962A (zh) * 2016-12-05 2017-05-31 济南浪潮高新科技投资发展有限公司 一种通用的Excel数据导入多个数据库物理表方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131846A (zh) * 2020-09-07 2020-12-25 北京思特奇信息技术股份有限公司 一种基于映射关系进行传参的方法及***、电子装置、存储介质
CN112131846B (zh) * 2020-09-07 2024-06-04 北京思特奇信息技术股份有限公司 一种基于映射关系进行传参的方法及***、电子装置、存储介质

Also Published As

Publication number Publication date
CN107679056A (zh) 2018-02-09
CN107679056B (zh) 2021-03-02

Similar Documents

Publication Publication Date Title
WO2019000698A1 (zh) 生成sql语句的方法、***、电子装置及可读存储介质
WO2020015166A1 (zh) 图表组件的创建方法、装置及计算机可读存储介质
US8949776B2 (en) Gateway consumption framework
US10216826B2 (en) Database query system
CN109446218A (zh) Sql语句生成方法、装置及计算机可读存储介质
US20130152038A1 (en) Project management workflows
US10705806B1 (en) Managing an application variable using variable attributes
US20220035847A1 (en) Information retrieval
JP2021182415A (ja) コントロールを使用して汎用プログラムを構成する技法
WO2019041441A1 (zh) 列表视图的更新装置、方法及计算机可读存储介质
JP5619328B1 (ja) シーケンスプログラム作成支援装置
JP2006172446A (ja) 複合データアクセス
US8413109B2 (en) Systems and methods for metamodel transformation
US20140331162A1 (en) Quick time-related data entry
CN110837366A (zh) 一种表单生成方法、电子装置及计算机可读存储介质
WO2019071898A1 (zh) 电子装置、数据库查询脚本生成方法及存储介质
US11693873B2 (en) Systems and methods for using entity/relationship model data to enhance user interface engine
CN108763341B (zh) 电子装置、自动化建表方法及存储介质
US20130247051A1 (en) Implementation of a process based on a user-defined sub-task sequence
US8732655B2 (en) Systems and methods for metamodel transformation
WO2016131360A1 (zh) 小部件文件生成方法和装置
CN111723077A (zh) 数据字典维护方法、装置及计算机设备
CN110727777A (zh) 知识图谱的管理方法、装置、计算机设备和存储介质
CN114328552A (zh) 数据库的管理方法、***及计算机可读介质
US10969931B2 (en) Data mapping service

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17915297

Country of ref document: EP

Kind code of ref document: A1