CN111984671B - Method for generating view script - Google Patents

Method for generating view script Download PDF

Info

Publication number
CN111984671B
CN111984671B CN202010732487.8A CN202010732487A CN111984671B CN 111984671 B CN111984671 B CN 111984671B CN 202010732487 A CN202010732487 A CN 202010732487A CN 111984671 B CN111984671 B CN 111984671B
Authority
CN
China
Prior art keywords
information
field
view
configuration
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.)
Active
Application number
CN202010732487.8A
Other languages
Chinese (zh)
Other versions
CN111984671A (en
Inventor
刘洋
姜跃滨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tianjian Source Technology Co ltd
Original Assignee
Beijing Tianjian Source Technology Co ltd
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 Beijing Tianjian Source Technology Co ltd filed Critical Beijing Tianjian Source Technology Co ltd
Priority to CN202010732487.8A priority Critical patent/CN111984671B/en
Publication of CN111984671A publication Critical patent/CN111984671A/en
Application granted granted Critical
Publication of CN111984671B publication Critical patent/CN111984671B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging

Abstract

The embodiment of the invention relates to a method for generating a view script, which comprises the following steps: when the second configuration information of the source table field configuration file is all empty, converting the first configuration information of the source table field configuration file into first field name information and annotation information according to the configuration information conversion mode data; when the second configuration information is not empty, the first configuration information and the second configuration information are used as first field name information and annotation information; adding prefix information and suffix information to the first field name information to generate second field name information; splicing the view creation instruction information according to the second field name information, the first field annotation information, the source table name information and the view name information; and adding the creating view instruction information to the SQL script to generate the creating view script. According to the embodiment of the invention, the creation view script is generated by analyzing the source table field configuration file, so that the writing workload and error rate of the artificial script are reduced, and the script accuracy and the database development efficiency are improved.

Description

Method for generating view script
Technical Field
The invention relates to the technical field of data information processing, in particular to a method for generating a view script.
Background
The structured query language (Structured Query Language, SQL) is a computer language conforming to the national INSTITUTE of standards (AMERICAN NATIONAL STANDARDS INSTUTTE, ANSI) standard for accessing and operating database systems. Common database systems support automatic execution of SQL scripts and execution of batch SQL instructions in the SQL scripts. The use of SQL scripts to generate database items is to create various objects of the database. Regarding various objects of the database, the base objects include database objects, table objects, VIEW (VIEW) objects, etc.; wherein, a plurality of table objects and view objects can be created in the database object, the table objects store actual data fields and corresponding field values, and the view objects are visual class table objects generated by extracting fields conforming to query conditions from fields of the source table object by designating the query conditions. Therefore, a large amount of manual writing work for creating view scripts is included in the development work of database projects, and the script error rate cannot be kept stable.
Disclosure of Invention
The invention aims at overcoming the defects of the prior art and provides a method for generating a view script, a computer program product and a computer readable storage medium, which automatically generate the view script by analyzing a source table field configuration file, thereby reducing the workload and the error rate of manual script writing and improving the script accuracy and the database project development efficiency.
To achieve the above object, a first aspect of an embodiment of the present invention provides a method for generating a creation view script, the method including:
acquiring source list name information and view name information, and acquiring a source list field configuration file; the source table field configuration file comprises a first number N of field configuration records; the field configuration record comprises first configuration information and second configuration information;
when the content of the second configuration information is all empty, acquiring configuration information conversion mode data; when the configuration information conversion mode data is a first mode, extracting the initial information of the Chinese phonetic alphabet of the first configuration information, generating first field name information, and taking the first configuration information as first field annotation information; when the configuration information conversion mode data is a second mode, extracting Chinese character pinyin full-spelling information of the first configuration information, generating first field name information, and taking the first configuration information as first field annotation information;
when the content of the second configuration information is not empty, the first configuration information is used as the first field name information, and the second configuration information is used as the first field annotation information;
acquiring prefix information and suffix information;
splicing the prefix information, the first field name information and the suffix information into second field name information;
creating a coding rule of a view instruction according to a Structured Query Language (SQL), and performing field parameter assembly processing according to the second field name information and the first field annotation information to generate first field parameter information;
according to the coding rule of the SQL creating view instruction, all the first field parameter information is spliced into a first field parameter information set;
according to the coding rule of the SQL view creation instruction, performing view creation instruction assembly processing according to the first field parameter information set, the source table name information and the view name information to generate view creation instruction information;
and adding the view creation instruction information into the SQL script according to the writing rule of the SQL script to generate a view creation script.
Preferably, the encoding rule of creating the view instruction according to the structured query language SQL carries out field parameter assembly processing according to the second field name information and the first field annotation information to generate first field parameter information, which specifically includes:
according to the coding rule of the structured query language SQL creation view instruction, determining that the field parameter separator information is ",", and determining that the field parameter annotation information is "-"; and splicing the second field name information, the field parameter separator information, the field parameter annotation information and the first field annotation information into the first field parameter information.
Preferably, the encoding rule for creating a view instruction according to SQL carries out assembly processing of the view instruction to create view instruction information according to the first field parameter information set, the source table name information and the view name information, and specifically includes:
and taking the first field parameter information set as a field parameter information set of the view creation instruction, taking the source table name information as source table parameter information of the view creation instruction, taking the view name information as view name parameter information of the view creation instruction, and carrying out instruction assembly according to the coding rule of the SQL view creation instruction to generate the view creation instruction information.
Preferably, when the file format of the source table field configuration file is specifically the spreadsheet EXCEL file format of microsoft office software;
when the structure of the EXCEL table of the source table field configuration file is the N rows by 1 column, a first column of the EXCEL table includes the N pieces of first configuration information;
when the structure of the EXCEL table of the source table field configuration file is the N rows by 2 columns, the first column of the EXCEL table includes the N pieces of the first configuration information, and the second column of the EXCEL table includes the N pieces of the second configuration information.
A second aspect of an embodiment of the present invention provides a computer program product comprising computer program code which, when executed by a computer, causes the computer to perform the method of the first aspect described above.
A third aspect of the embodiments of the present invention provides a computer-readable storage medium storing computer instructions that, when executed by a computer, cause the computer to perform the instructions of the method of the first aspect.
The embodiment of the invention provides a method for generating a view script, a computer program product and a computer readable storage medium, which automatically generate the view script by analyzing a source table field configuration file, reduce the workload and the error rate of manual script writing and improve the script accuracy and the database project development efficiency.
Drawings
Fig. 1 is a schematic diagram of a method for generating a view script according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Before describing in detail the steps of a method for generating a view script provided by an embodiment of the present invention, a simple description is made of coding rules of an SQL view (CREATE VIEW) creation instruction:
CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
wherein, "CREATE VIEW … … AS SELECT … … FROM" is the code structure of the SQL CREATE VIEW instruction; "view_name" is view name parameter information of the SQL CREATE VIEW instruction, i.e., the name of the view object created by executing the SQL CREATE VIEW instruction; the table_name is the source table parameter information of the SQL CREATE VIEW instruction, namely the name of the source table object of the view query; the "column_name(s)" is a field parameter information set of SQL CREATE VIEW instructions, that is, the view selects a queried field information set from source table objects, each "column_name" in the "column_name" corresponds to a field name in the source table object, a field parameter separator is adopted between the "column_names", and each "column_name" is provided with a field parameter annotation by adopting a field parameter annotation symbol "-" as a parameter isolation symbol. For example, 5 fields are included in the source table 1: XM (name), NL (age), XB (gender), DZ (address) and TX (communication), 3 fields are selected from the source table 1: XM, NL and XB, generate view1 and annotate the corresponding field notes in the code that created the view, the instruction code of the SQL CREATE VIEW instruction should be specified as follows:
the SQL script mentioned in the text is a file storing SQL instructions, and the instruction writing format of the SQL instructions stored in the SQL script accords with the corresponding SQL instruction coding rule. The view creation script is an SQL script storing view creation instruction information conforming to the SQL CREATE VIEW instruction encoding rule.
An engineer uses the method for generating the view script provided by the embodiment of the invention, and only edits the source table field configuration file without manually writing the SQL script. When the source table field referenced by the view object changes, only the table field configuration file is required to be modified, and the generated script is not required to be manually updated. When the SQL script file is subjected to content auditing, the content of the table field configuration file is only required to be checked. Therefore, the standardization of the script can be improved, the error rate of the script can be reduced, the working time of engineers can be saved, and the development efficiency of database projects can be improved.
As shown in fig. 1, which is a schematic diagram of a method for generating a view script according to an embodiment of the present invention, the method mainly includes the following steps:
step 1, acquiring source list name information and view name information, and acquiring a source list field configuration file;
specifically, the source table name information, the view name information and the source table field configuration file are acquired from a storage medium (memory buffer, data storage area, etc.) of the database or a storage medium (memory buffer, data storage area, etc.) connected with the database;
the source table field configuration file comprises a first number N of field configuration records; the field configuration record comprises first configuration information and second configuration information; here, N is an integer greater than or equal to 1.
Here, the source table name information is the name of the source table object in the database for which the view query needs to be created; the view name information is the name of the view to be created in the database; the source table field configuration file includes N field configuration records, each field configuration record corresponding to a query field in a source table object. The second configuration information in the field configuration record may be null.
For example, the source table object includes 5 fields as shown in table one:
fields Field description
XM To store name information
NL To store age information
XB To store sex information
DZ For storing address information
TX For storing communication information
List one
When the data related to the three fields of XM, NL and XB is to be queried from the source table object of the first table, N is 3, and the corresponding source table field configuration file can be set as shown in the second table (the second configuration information is all null) or as shown in the third table (the second configuration information is not all null).
Field configuration record index First configuration information Second configuration information
Field configuration record 1 Name of name Empty space
Field configuration record 2 Age of Empty space
Field configuration record 3 Sex (sex) Empty space
Watch II
Watch III
Step 2, judging whether the second configuration information is all empty, and when the second configuration information is all empty, turning to step 3; when the second configuration information is not all empty, go to step 4.
As shown in the second table, the second configuration information in the field configuration record may be all empty, and when the second configuration information is all empty, the first configuration information is parsed in the step 3, and the field name and the field annotation are extracted for subsequent assembly of the view creation instruction; as shown in table three, when the second configuration information is not all empty, the first configuration information is directly used as a field name and the second configuration information is used as a field annotation for subsequent view creation instruction assembly through step 4.
Step 3, acquiring configuration information conversion mode data, extracting Chinese character pinyin initial information of first configuration information when the configuration information conversion mode data is in a first mode, generating first field name information, and taking the first configuration information as first field annotation information; when the configuration information conversion mode data is the second mode, extracting the Chinese character pinyin full-spelling information of the first configuration information, generating first field name information, and taking the first configuration information as first field annotation information; go to step 5.
Specifically, the configuration information conversion mode data is acquired from a storage medium (memory buffer, data storage area, etc.) of the database or a storage medium (memory buffer, data storage area, etc.) connected to the database.
Here, the configuration information conversion mode data includes two modes, a first mode and a second mode: the first mode illustrates that the names of the fields of the source table object are the initial combination of Chinese phonetic alphabets of the first configuration information, and the second mode illustrates that the names of the fields of the source table object are the full combination of Chinese phonetic alphabets of the first configuration information.
For example, if the source table object is shown in table one and the source table field configuration file is shown in table two, the configuration information is converted into the mode data into the first mode; and the source table object is shown in the following table four, and the source table field configuration file is shown in the table two, so that the configuration information conversion mode data is the second mode. The first mode is generally employed.
Table four
When the source table object is shown in table one, the source table field configuration file is shown in table two, and the configuration information conversion mode data is preset to be the first mode, the first field name information and the first field annotation information generated according to the source table field configuration file are shown in table five.
First field name information First field annotation information
XM Name of name
NL Age of
XB Sex (sex)
TABLE five
When the source table object is shown in table four, the source table field configuration file is shown in table two, and the configuration information conversion mode data is preset to be in the second mode, the first field name information and the first field annotation information generated according to the source table field configuration file are shown in table six.
First field name information First field annotation information
XINGMING Name of name
NIANLING Age of
XINGBIE Sex (sex)
TABLE six
And 4, taking the first configuration information as first field name information and the second configuration information as first field annotation information.
Here, the first configuration information is directly used as a field name corresponding to the source table object by default, and the second configuration information is used as a field annotation corresponding to the first configuration information.
For example, if the source table object is shown in table one and the source table field configuration file is shown in table three, the first field name information generated according to the source table field configuration file is the first configuration information, and the first field annotation information generated is the second configuration information, as shown in table seven.
First field name information First field annotation information
XM Name of name
NL Age of
XB Sex (sex)
Watch seven
Step 5, acquiring prefix information and suffix information;
specifically, the prefix information and the suffix information are acquired from a storage medium (memory buffer, data storage area, etc.) of the database or a storage medium (memory buffer, data storage area, etc.) connected to the database.
Here, when creating a table object in a database, unified prefix information and/or suffix information, such as table eight, may sometimes be added to fields in the table object. Such prefix information and suffix information may also change uniformly when a table object is updated, for example, from the source table object contents to table nine after the table eight is updated.
Fields Field description
01_XM_V01 To store name information
01_NL_V01 To store age information
01_XB_V01 To store sex information
01_DZ_V01 For storing address information
01_TX_V01 For storing communication information
Table eight
Table nine
And 6, splicing the prefix information, the first field name information and the suffix information to generate second field name information.
Here, if the first configuration information of the source table field configuration file corresponding to the table eight is set to be consistent with the source table field, after the table eight is upgraded to the table nine, in order to ensure that the first field name information can be consistent with the field name in the table, all the first configuration information of the source table field configuration file corresponding to the table eight needs to be modified by the prefix and/or the suffix. The embodiment of the invention provides prefix information and suffix information to remove the workload. The splice rules here are: second field name information=prefix information+first field name information+suffix information.
For example, the source table object is shown in table eight, the source table field configuration file is shown in table three, the first field name information and the first field annotation information obtained after the processing in step 4 are shown in table seven, the prefix information obtained in step 5 is "01_" and the suffix information is "_ V01", and if all the first field name information in the table seven is spliced with prefix and suffix information, new second field name information and first field annotation information are obtained as shown in table ten.
Second field name information First field annotation information
01_XM_V01 Name of name
01_NL_V01 Age of
01_XB_V01 Sex (sex)
Ten meters
Here, when the prefix information and/or the suffix information obtained from step 5 are both empty, the second field name information in step 6 is actually the first field name information.
Step 7, creating a coding rule of the view instruction according to SQL, and performing field parameter assembly processing according to the second field name information and the first field annotation information to generate first field parameter information;
the method specifically comprises the following steps: step 71, according to the coding rule of the SQL creation view instruction, determining that the field parameter separator information is ",", and determining that the field parameter annotation information is "-";
here, as described above, in the SQL create view instruction coding format, the field parameter separators are used between the "column_name" and used as parameter isolation symbols, and the field parameter annotators "-" are used after each "column_name" to provide the field annotation content;
step 72, concatenating the second field name information, the field parameter separator information, the field parameter annotator information, and the first field annotation information into first field parameter information.
Here, the first field parameter information is spliced in such a manner that the first field parameter information=the second field name information+the field parameter separator information+the field parameter comment information+the first field comment information. For example, table eleven gives a detailed example.
Second field name information First field annotation information First field parameter information
XM Name of name XM, name
NL Age of NL- -age
XB Sex (sex) XB, sex
Table eleven
And 8, creating a coding rule of the view instruction according to SQL, and splicing all the first field parameter information into a first field parameter information set.
Here, the splicing rule of the first field parameter information set is to splice N pieces of first field parameter information sequentially, and the middle is usually isolated by using a line feed mode.
For example, if the source table object is shown in table one, the source table field configuration file is shown in table three, N is 3, the prefix information and the suffix information are all null, and the 3 first field parameter information is shown in table eleven, the obtained first field parameter information set should be:
XM, name
NL- -age
XB- - -gender.
Step 9, according to the coding rule of the SQL creating view instruction, carrying out creating view instruction assembling processing according to the first field parameter information set, the source table name information and the view name information, and generating creating view instruction information;
the method specifically comprises the following steps: and taking the first field parameter information set as the field parameter information set of the view creation instruction, taking the source table name information as the source table parameter information of the view creation instruction, taking the view name information as the view name parameter information of the view creation instruction, and carrying out instruction assembly according to the coding rule of the SQL view creation instruction to generate view creation instruction information.
As described above, the encoding rules for the SQL create view instruction are:
CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
here, the first field parameter information set is used as the content of column_name(s), the source table name information is used as the content of table_name, and the view name information is used as the content of view_name.
For example, the first set of field parameter information, source table name information and view name information are shown in table twelve,
and the tenth two, the generated view creation instruction information should be:
and step 10, adding the view creation instruction information into the SQL script according to the writing rule of the SQL script, and generating the view creation script.
Here, the common SQL script is a text type file with a suffix ". SQL", where the creating view script is obtained by saving the creating view instruction information obtained in step 9 into a file with a suffix ". SQL". The name specification for creating a view script may be specified by default: CREATEVIEW-view name information. Sql.
Finally, for the source table field configuration file, the file format of the file is not particularly limited in practical application, as long as the correct field configuration record can be extracted from the source table field configuration file. Taking the EXCEL file format of microsoft office software as an example, when the EXCEL table of the source table field configuration file has a structure of N rows by 1 column, N pieces of data in the first column of the EXCEL table are N pieces of first configuration information; when the structure of the EXCEL table of the source table field configuration file is N rows by 2 columns, N data in the first column of the EXCEL table are N pieces of first configuration information, and N data in the second column are N pieces of second configuration information.
For example, the file format of the source table field configuration file is an EXCEL file format, when the data content of the source table field configuration file is shown in table two, N is 3, the EXCEL table of the source table field configuration file has only the first column, and each row of data in the column corresponds to 3 pieces of first configuration information in table two respectively, as shown in table thirteen; when the method for generating the view script is used, the data in the first column are sequentially extracted to serve as first configuration information; converting the field name of the first configuration information according to preset configuration information conversion mode data to obtain first field name information (when in a first mode, extracting pinyin initial information of the first configuration information to serve as the first field name information, and when in a second mode, extracting pinyin full-spelling information of the first configuration information to serve as the first field name information); then the first configuration information is used as first field annotation information; acquiring prefix information and suffix information, and splicing the first field name information to obtain second field name information: prefix information+first field name information+suffix information; then creating the coding rule of the view instruction according to SQL by using the second field name information, the first field annotation information, the source table name information, the view name information and the like to obtain view instruction creating information; and finally, adding the view creation instruction information into the SQL script to obtain the view creation script.
Watch thirteen
When the data content of the source table field configuration file is shown in table three, the EXCEL table of the source table field configuration file should have a first column and a second column, where each line of the first column corresponds to 3 pieces of first configuration information in table three, and each line of the second column corresponds to 3 pieces of second configuration information in table three, as shown in table fourteen. When the method for generating the view script is used, the data in the first column are sequentially extracted to serve as first configuration information, and the data in the second column are sequentially extracted to serve as second configuration information; the first configuration information is used as first field name information, and the second configuration information is used as first field annotation information; acquiring prefix information and suffix information, and splicing the first field name information to obtain second field name information: prefix information+first field name information+suffix information: then creating the coding rule of the view instruction according to SQL by using the second field name information, the first field annotation information, the source table name information, the view name information and the like to obtain view instruction creating information; and finally, adding the view creation instruction information into the SQL script to obtain the view creation script.
Fourteen watch
It should be noted that, the present embodiment further provides a computer readable storage medium, where instructions are stored, when the instructions are executed on a computer, to cause the computer to perform the steps and the processing procedures of the method provided by the embodiment of the present invention.
The embodiment of the present invention also provides a computer program product, which includes a computer program, where the computer program is stored in a storage medium, and at least one processor may read the computer program from the storage medium, where the at least one processor performs the steps and processes of the method provided by the embodiment of the present invention.
The embodiment of the invention provides a method for generating a view script, a computer program product and a computer readable storage medium, which automatically generate the view script by analyzing a source table field configuration file, reduce the workload and the error rate of manual script writing and improve the script accuracy and the database project development efficiency.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of function in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (5)

1. A method of generating a create view script, the method comprising:
acquiring source list name information and view name information, and acquiring a source list field configuration file; the source table field configuration file comprises a first number N of field configuration records; the field configuration record comprises first configuration information and second configuration information;
when the content of the second configuration information is all empty, acquiring configuration information conversion mode data; when the configuration information conversion mode data is a first mode, extracting the initial information of the Chinese phonetic alphabet of the first configuration information, generating first field name information, and taking the first configuration information as first field annotation information; when the configuration information conversion mode data is a second mode, extracting Chinese character pinyin full-spelling information of the first configuration information, generating first field name information, and taking the first configuration information as first field annotation information;
when the content of the second configuration information is not empty, the first configuration information is used as the first field name information, and the second configuration information is used as the first field annotation information;
acquiring prefix information and suffix information;
splicing the prefix information, the first field name information and the suffix information into second field name information;
creating a coding rule of a view instruction according to a Structured Query Language (SQL), and performing field parameter assembly processing according to the second field name information and the first field annotation information to generate first field parameter information;
according to the coding rule of the SQL creating view instruction, all the first field parameter information is spliced into a first field parameter information set;
according to the coding rule of the SQL view creation instruction, performing view creation instruction assembly processing according to the first field parameter information set, the source table name information and the view name information to generate view creation instruction information;
and adding the view creation instruction information into the SQL script according to the writing rule of the SQL script to generate a view creation script.
2. The method for generating view script according to claim 1, wherein the encoding rule for creating view instructions according to the structured query language SQL performs field parameter assembly processing according to the second field name information and the first field annotation information to generate first field parameter information, and specifically includes:
according to the coding rule of the structured query language SQL creation view instruction, determining that the field parameter separator information is ",", and determining that the field parameter annotation information is "-"; and splicing the second field name information, the field parameter separator information, the field parameter annotation information and the first field annotation information into the first field parameter information.
3. The method for generating view creation script according to claim 1, wherein the creating view instruction assembling process is performed according to the encoding rule of the SQL view creation instruction according to the first field parameter information set, the source table name information and the view name information, and the creating view instruction information is generated specifically including:
and taking the first field parameter information set as a field parameter information set of the view creation instruction, taking the source table name information as source table parameter information of the view creation instruction, taking the view name information as view name parameter information of the view creation instruction, and carrying out instruction assembly according to the coding rule of the SQL view creation instruction to generate the view creation instruction information.
4. The method of generating a create view script according to claim 1, wherein when the file format of the source table field configuration file is in particular the spreadsheet EXCEL file format of microsoft office software;
when the structure of the EXCEL table of the source table field configuration file is N rows by 1 column, a first column of the EXCEL table includes the N pieces of first configuration information;
when the structure of the EXCEL table of the source table field configuration file is N rows by 2 columns, the first column of the EXCEL table includes the N pieces of the first configuration information, and the second column of the EXCEL table includes the N pieces of the second configuration information.
5. A computer readable storage medium storing computer instructions which, when executed by a computer, cause the computer to perform the instructions of the method of any one of claims 1-4.
CN202010732487.8A 2020-07-27 2020-07-27 Method for generating view script Active CN111984671B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010732487.8A CN111984671B (en) 2020-07-27 2020-07-27 Method for generating view script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010732487.8A CN111984671B (en) 2020-07-27 2020-07-27 Method for generating view script

Publications (2)

Publication Number Publication Date
CN111984671A CN111984671A (en) 2020-11-24
CN111984671B true CN111984671B (en) 2023-09-12

Family

ID=73444285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010732487.8A Active CN111984671B (en) 2020-07-27 2020-07-27 Method for generating view script

Country Status (1)

Country Link
CN (1) CN111984671B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101158958A (en) * 2007-10-23 2008-04-09 浙江大学 Fusion enquire method based on MySQL storage engines
CN101401098A (en) * 2006-01-30 2009-04-01 法斯特凯特有限公司 A portable dataport device and method for retrieving, inter-relating, annotating and managing electronic documents at a point of need
CN101826087A (en) * 2009-03-02 2010-09-08 中兴通讯股份有限公司 Configuration device and method of coding information data
CN102096670A (en) * 2009-12-14 2011-06-15 深圳速浪数字技术有限公司 Data dictionary generation method and device
CN103177046A (en) * 2011-12-26 2013-06-26 中国移动通信集团公司 Data processing method and data processing device based on line storage data base
CN105989082A (en) * 2015-02-10 2016-10-05 腾讯科技(深圳)有限公司 Report view generation method and apparatus
CN110109951A (en) * 2017-12-29 2019-08-09 华为软件技术有限公司 A kind of method of correlation inquiry, database application system and server
CN110531964A (en) * 2019-08-30 2019-12-03 苏州中弘软件技术有限公司 The intelligent developed method of software personalisation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9875276B2 (en) * 2015-06-15 2018-01-23 Sap Se Database view generation

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101401098A (en) * 2006-01-30 2009-04-01 法斯特凯特有限公司 A portable dataport device and method for retrieving, inter-relating, annotating and managing electronic documents at a point of need
CN101158958A (en) * 2007-10-23 2008-04-09 浙江大学 Fusion enquire method based on MySQL storage engines
CN101826087A (en) * 2009-03-02 2010-09-08 中兴通讯股份有限公司 Configuration device and method of coding information data
CN102096670A (en) * 2009-12-14 2011-06-15 深圳速浪数字技术有限公司 Data dictionary generation method and device
CN103177046A (en) * 2011-12-26 2013-06-26 中国移动通信集团公司 Data processing method and data processing device based on line storage data base
CN105989082A (en) * 2015-02-10 2016-10-05 腾讯科技(深圳)有限公司 Report view generation method and apparatus
CN110109951A (en) * 2017-12-29 2019-08-09 华为软件技术有限公司 A kind of method of correlation inquiry, database application system and server
CN110531964A (en) * 2019-08-30 2019-12-03 苏州中弘软件技术有限公司 The intelligent developed method of software personalisation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
浅谈FireBird数据库SQL语句的优化;刘华;电脑知识与技术;第12卷(第16期);18-19 *

Also Published As

Publication number Publication date
CN111984671A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN111061757B (en) Language conversion method and device of database, electronic equipment and storage medium
US10169337B2 (en) Converting data into natural language form
US20150026556A1 (en) Systems and Methods for Extracting Table Information from Documents
CN115061721A (en) Report generation method and device, computer equipment and storage medium
CN112199302A (en) Test data generation method and system, corresponding equipment and storage medium
CN111475196A (en) Compiling alarm tracing method and device, electronic equipment and computer readable medium
CN111984671B (en) Method for generating view script
CN113297831A (en) Method and system for generating verifiable report webpage by Excel
CN112506488A (en) Method for generating programming language class based on sql creating statement
CN111259038A (en) Database query and data export method, system, medium and equipment
CN116360794A (en) Database language analysis method, device, computer equipment and storage medium
CN115934716A (en) Method for importing Excel table data into database based on metadata definition and implementation
CN110058858B (en) JSON data processing method and device
CN113703777A (en) Code generation method and device based on database table, storage medium and equipment
CN112650754A (en) Method for importing total data of relational database into Hive
CN111126015B (en) Report form compiling method and equipment
JP4415768B2 (en) Address table generation support method, apparatus and program
CN111221846B (en) Automatic translation method and device for SQL sentences
CN114942766A (en) Excel function conversion method based on SQL database and related device
CN117707536A (en) Flow chart drawing method and system, computer readable storage medium and terminal
CN114168189A (en) Vue project code translation method, device and medium
CN116955883A (en) HTML text table rendering method and storage medium
CN117171189A (en) Data processing method, device and equipment
CN117668075A (en) Data element generation method, device, equipment and storage medium
CN116931943A (en) Grammar conversion method and device of index definition text and electronic equipment

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
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method for generating view creation scripts

Granted publication date: 20230912

Pledgee: Beijing Zhongguancun bank Limited by Share Ltd.

Pledgor: BEIJING TIANJIAN SOURCE TECHNOLOGY CO.,LTD.

Registration number: Y2024980008149

PE01 Entry into force of the registration of the contract for pledge of patent right