CN113468251A - DB2 data query result processing method and device - Google Patents
DB2 data query result processing method and device Download PDFInfo
- Publication number
- CN113468251A CN113468251A CN202110795550.7A CN202110795550A CN113468251A CN 113468251 A CN113468251 A CN 113468251A CN 202110795550 A CN202110795550 A CN 202110795550A CN 113468251 A CN113468251 A CN 113468251A
- Authority
- CN
- China
- Prior art keywords
- data
- splicing
- query result
- result
- input source
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 16
- 238000013515 script Methods 0.000 claims abstract description 25
- 238000000034 method Methods 0.000 claims abstract description 14
- 238000004590 computer program Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 14
- 238000004458 analytical method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000007405 data analysis Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/248—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a DB2 data query result processing method and a device, which can be used in the field of finance, wherein the method comprises the following steps: obtaining input source data and corresponding configuration parameters, wherein the types of the configuration parameters comprise: DB2SQL script, query result file, query operation LOG; performing data splicing processing on the input source data according to the configuration parameters to obtain a splicing result; and according to the splicing result, performing DB2 data query result processing. The invention can process the DB2 data query result, improve the processing efficiency and save manpower and material resources.
Description
Technical Field
The invention relates to the field of finance, in particular to a DB2 data query result processing method and device. It should be noted that the method and apparatus for processing the data query result of the DB2 according to the present invention can be used in the financial field, and can also be used in any field other than the financial field, and the application field of the method and apparatus for processing the data query result of the DB2 according to the present invention is not limited.
Background
In a large-scale host environment, when table data is queried for the DB2, a query result LOG broken line phenomenon may occur when there are many query columns or the contents of the table columns are too long. For subsequent analysis of data based on query results, difficulties arise due to the fold.
In the prior art, the folding positions are usually spliced together by a manual or VB development tool, however, especially for the condition that the number of the query result lines is large, both methods need to consume a large amount of manpower and time, and manual processing belongs to repeated labor and wastes manpower and material resources.
Therefore, a DB2 data query result processing scheme that can overcome the above problems is needed.
Disclosure of Invention
The embodiment of the invention provides a DB2 data query result processing method, which is used for processing DB2 data query results, improving the processing efficiency and saving manpower and material resources, and comprises the following steps:
obtaining input source data and corresponding configuration parameters, wherein the types of the configuration parameters comprise: DB2SQL script, query result file, query operation LOG;
performing data splicing processing on the input source data according to the configuration parameters to obtain a splicing result;
and according to the splicing result, performing DB2 data query result processing.
The embodiment of the invention provides a DB2 data query result processing device, which is used for processing DB2 data query results, improving the processing efficiency and saving manpower and material resources, and comprises the following components:
a parameter obtaining module, configured to obtain input source data and corresponding configuration parameters, where the types of the configuration parameters include: DB2SQL script, query result file, query operation LOG;
the data splicing module is used for carrying out data splicing processing on the input source data according to the configuration parameters to obtain a splicing result;
and the result processing module is used for processing the data query result of the DB2 according to the splicing result.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the DB2 data query result processing method.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program for executing the DB2 data query result processing method is stored in the computer-readable storage medium.
According to the embodiment of the invention, input source data and corresponding configuration parameters are obtained, and the types of the configuration parameters comprise: DB2SQL script, query result file, query operation LOG; performing data splicing processing on the input source data according to the configuration parameters to obtain a splicing result; and according to the splicing result, performing DB2 data query result processing. According to the embodiment of the invention, the user flexibly configures the parameters of the input source data and performs data splicing processing on the input source data according to different types of configuration parameters, so that the processing efficiency is effectively improved and manpower and material resources are saved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a diagram illustrating a method for processing a data query result of DB2 according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a data splicing processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another data splicing method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating the structure of a data query result processing apparatus of DB2 according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
As described above, in a mainframe environment, when the DB2 lookup table data is used, if there are many lookup columns or a column has a long content, the lookup result LOG has a longest length limit, and when the length exceeds the longest length, the content of a certain row of the lookup data cannot be displayed in the same row, so that a line folding phenomenon occurs, that is, a certain row of data in the data table will be displayed in multiple rows in the lookup result. For example:
in order to perform DB2 data query result processing, improve processing efficiency, and save manpower and material resources, an embodiment of the present invention provides a DB2 data query result processing method, as shown in fig. 1, where the method may include:
102, performing data splicing processing on the input source data according to the configuration parameters to obtain a splicing result;
and 103, processing the data query result of the DB2 according to the splicing result.
As shown in fig. 1, in the embodiment of the present invention, input source data and corresponding configuration parameters are obtained, where the types of the configuration parameters include: DB2SQL script, query result file, query operation LOG; performing data splicing processing on the input source data according to the configuration parameters to obtain a splicing result; and according to the splicing result, performing DB2 data query result processing. According to the embodiment of the invention, the user flexibly configures the parameters of the input source data and performs data splicing processing on the input source data according to different types of configuration parameters, so that the processing efficiency is effectively improved and manpower and material resources are saved.
In an embodiment, input source data and corresponding configuration parameters are obtained, and the types of the configuration parameters include: DB2SQL script, query results file, query job LOG.
It should be noted that the DB2SQL script is a select query script for querying database data, the query result file is a database data result file for recording queries from the select script, and the query job LOG is an execution result LOG record of a job for executing the select query script.
In this embodiment, a user may perform parameter configuration on input source data according to a requirement to obtain a configuration parameter corresponding to the input source data.
In the embodiment, according to the configuration parameters, data splicing processing is performed on the input source data to obtain a splicing result.
In this embodiment, as shown in fig. 2, performing data splicing processing on the input source data according to the configuration parameter includes:
and 203, splicing the data with the same number in the execution result into a line for the temporary file.
In this embodiment, performing data splicing processing on the input source data according to the configuration parameter includes:
and if the type of the configuration parameters is the query result file, splicing the data with the same number in the query result file into a line.
In this embodiment, as shown in fig. 3, performing data splicing processing on the input source data according to the configuration parameter includes:
and 303, splicing the data with the same number in the operation LOG into a row.
In the embodiment, according to the splicing result, the DB2 data query result processing is carried out.
During specific implementation, all columns in the splicing result are sequentially subjected to unified length adjustment processing, the length of each column is ensured to be consistent with that of the same column in each row, and the user can conveniently check and perform subsequent analysis.
A specific embodiment is given below to illustrate a specific application of the DB2 data query result processing in the embodiment of the present invention.
In this embodiment, the DB2 data query result processing is performed as follows:
1. obtaining configuration parameters input by a user, such as whether an input source is a DB2SQL script, a query result file or a query operation LOG;
2. processing input source data conforming to the configuration parameters based on the provided configuration parameters;
3. and outputting the final processing and line folding completed result to generate a relatively regular format for subsequent analysis by a user.
Finally, the length of each line can be expanded, and the line folding result is converted into the following result, so that convenience is provided for data analysis:
the embodiment of the invention can be flexibly configured according to the actual requirements of users, and realizes diversified input source data. And the problem of broken lines can be efficiently processed, the processed result is provided for a user, the analysis of subsequent data is greatly facilitated, and the efficient processing efficiency is realized. The user can flexibly configure the input sources into the following three types according to the own requirements of the user: DB2SQL scripts, query result files and query operation LOG. For the folding processing of large data volume, the efficiency is high, the Chinese support degree is good, the output result is neat, and the user can analyze the data query result more conveniently and rapidly.
Based on the same inventive concept, the embodiment of the present invention further provides a DB2 data query result processing apparatus, as described in the following embodiments. Since the principles of these solutions are similar to the DB2 data query result processing method, the implementation of the DB2 data query result processing apparatus can refer to the implementation of the method, and the repeated descriptions are omitted.
Fig. 4 is a structural diagram of a DB2 data query result processing apparatus according to an embodiment of the present invention, and as shown in fig. 4, the DB2 data query result processing apparatus includes:
a parameter obtaining module 401, configured to obtain input source data and corresponding configuration parameters, where the types of the configuration parameters include: DB2SQL script, query result file, query operation LOG;
a data splicing module 402, configured to perform data splicing processing on the input source data according to the configuration parameter to obtain a splicing result;
and the result processing module 403 is configured to perform data query result processing on the DB2 according to the splicing result.
In one embodiment, the data splicing module 402 is configured to:
if the type of the configuration parameter is DB2SQL script, executing the SQL script of the input source data to obtain an execution result;
caching the execution result into a temporary file;
and for the temporary file, splicing the data with the same number in the execution result into a line.
In one embodiment, the data splicing module 402 is configured to:
and if the type of the configuration parameters is the query result file, splicing the data with the same number in the query result file into a line.
In one embodiment, the data splicing module 402 is configured to:
if the type of the configuration parameter is query operation LOG, searching corresponding executed operation in input source data;
extracting a job LOG corresponding to the executed job;
and splicing the data with the same number in the operation LOG into a row.
In summary, in the embodiments of the present invention, by obtaining input source data and corresponding configuration parameters, the types of the configuration parameters include: DB2SQL script, query result file, query operation LOG; performing data splicing processing on the input source data according to the configuration parameters to obtain a splicing result; and according to the splicing result, performing DB2 data query result processing. According to the embodiment of the invention, the user flexibly configures the parameters of the input source data and performs data splicing processing on the input source data according to different types of configuration parameters, so that the processing efficiency is effectively improved and manpower and material resources are saved.
Based on the aforementioned inventive concept, as shown in fig. 5, the present invention further proposes a computer device 500, which comprises a memory 510, a processor 520 and a computer program 530 stored on the memory 510 and operable on the processor 520, wherein the processor 520 implements the aforementioned DB2 data query result processing method when executing the computer program 530.
Based on the aforementioned inventive concept, the present invention proposes a computer-readable storage medium storing a computer program which, when executed by a processor, implements the aforementioned DB2 data query result processing method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (10)
1. A DB2 data query result processing method is characterized by comprising the following steps:
obtaining input source data and corresponding configuration parameters, wherein the types of the configuration parameters comprise: DB2SQL script, query result file, query operation LOG;
performing data splicing processing on the input source data according to the configuration parameters to obtain a splicing result;
and according to the splicing result, performing DB2 data query result processing.
2. The DB2 data query result processing method of claim 1, wherein performing data splicing processing on the input source data according to the configuration parameters includes:
if the type of the configuration parameter is DB2SQL script, executing the SQL script of the input source data to obtain an execution result;
caching the execution result into a temporary file;
and for the temporary file, splicing the data with the same number in the execution result into a line.
3. The DB2 data query result processing method of claim 1, wherein performing data splicing processing on the input source data according to the configuration parameters includes:
and if the type of the configuration parameters is the query result file, splicing the data with the same number in the query result file into a line.
4. The DB2 data query result processing method of claim 1, wherein performing data splicing processing on the input source data according to the configuration parameters includes:
if the type of the configuration parameter is query operation LOG, searching corresponding executed operation in input source data;
extracting a job LOG corresponding to the executed job;
and splicing the data with the same number in the operation LOG into a row.
5. A DB2 data query result processing apparatus, comprising:
a parameter obtaining module, configured to obtain input source data and corresponding configuration parameters, where the types of the configuration parameters include: DB2SQL script, query result file, query operation LOG;
the data splicing module is used for carrying out data splicing processing on the input source data according to the configuration parameters to obtain a splicing result;
and the result processing module is used for processing the data query result of the DB2 according to the splicing result.
6. The DB2 data query result processing apparatus of claim 5, wherein the data concatenation module is to:
if the type of the configuration parameter is DB2SQL script, executing the SQL script of the input source data to obtain an execution result;
caching the execution result into a temporary file;
and for the temporary file, splicing the data with the same number in the execution result into a line.
7. The DB2 data query result processing apparatus of claim 5, wherein the data concatenation module is to:
and if the type of the configuration parameters is the query result file, splicing the data with the same number in the query result file into a line.
8. The DB2 data query result processing apparatus of claim 5, wherein the data concatenation module is to:
if the type of the configuration parameter is query operation LOG, searching corresponding executed operation in input source data;
extracting a job LOG corresponding to the executed job;
and splicing the data with the same number in the operation LOG into a row.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110795550.7A CN113468251A (en) | 2021-07-14 | 2021-07-14 | DB2 data query result processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110795550.7A CN113468251A (en) | 2021-07-14 | 2021-07-14 | DB2 data query result processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113468251A true CN113468251A (en) | 2021-10-01 |
Family
ID=77878432
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110795550.7A Pending CN113468251A (en) | 2021-07-14 | 2021-07-14 | DB2 data query result processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113468251A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050102310A1 (en) * | 2003-11-06 | 2005-05-12 | Marr Gary W. | Systems, methods and computer program products for automating retrieval of data from a DB2 database |
CN109325041A (en) * | 2018-08-14 | 2019-02-12 | 中国平安人寿保险股份有限公司 | Business data processing method, device, computer equipment and storage medium |
CN109947788A (en) * | 2017-10-30 | 2019-06-28 | 北京京东尚科信息技术有限公司 | Data query method and apparatus |
CN112380180A (en) * | 2020-11-17 | 2021-02-19 | 平安普惠企业管理有限公司 | Data synchronization processing method, device, equipment and storage medium |
CN112988784A (en) * | 2021-04-26 | 2021-06-18 | 广州思迈特软件有限公司 | Data query method, query statement generation method and device |
-
2021
- 2021-07-14 CN CN202110795550.7A patent/CN113468251A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050102310A1 (en) * | 2003-11-06 | 2005-05-12 | Marr Gary W. | Systems, methods and computer program products for automating retrieval of data from a DB2 database |
CN109947788A (en) * | 2017-10-30 | 2019-06-28 | 北京京东尚科信息技术有限公司 | Data query method and apparatus |
CN109325041A (en) * | 2018-08-14 | 2019-02-12 | 中国平安人寿保险股份有限公司 | Business data processing method, device, computer equipment and storage medium |
CN112380180A (en) * | 2020-11-17 | 2021-02-19 | 平安普惠企业管理有限公司 | Data synchronization processing method, device, equipment and storage medium |
CN112988784A (en) * | 2021-04-26 | 2021-06-18 | 广州思迈特软件有限公司 | Data query method, query statement generation method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8537160B2 (en) | Generating distributed dataflow graphs | |
US20170083573A1 (en) | Multi-query optimization | |
US9471651B2 (en) | Adjustment of map reduce execution | |
CN105677812A (en) | Method and device for querying data | |
CN111475564A (en) | Streaming data processing method, system, computer equipment and storage medium | |
CN107784026A (en) | A kind of ETL data processing methods and device | |
US20230259509A1 (en) | Data association query method and apparatus, device, and storage medium | |
US8140471B2 (en) | Framework for metadata-driven dynamic reporting systems and methods | |
CN107145538B (en) | Table data query method, device and system | |
CN106919697B (en) | Method for simultaneously importing data into multiple Hadoop assemblies | |
CN110968593A (en) | Database SQL statement optimization method, device, equipment and storage medium | |
CN105653647A (en) | Information acquisition method and system of SQL (Structured Query Language) statement | |
CN114036183A (en) | Data ETL processing method, device, equipment and medium | |
CN113515564A (en) | Data access method, device, equipment and storage medium based on J2EE | |
CN113468204A (en) | Data query method, device, equipment and medium | |
CN111966760A (en) | Hive data warehouse-based test data generation method and device | |
CN115774750A (en) | Database lake entering configuration method and system, electronic equipment and storage medium | |
CN104346378B (en) | A kind of method, apparatus and system for realizing complex data processing | |
CN110704472A (en) | Data query statistical method and device | |
CN110555185A (en) | Page customization method and system based on PC client | |
CN114238379A (en) | Report query method and system based on SQL generator | |
CN104537012A (en) | Data processing method and device | |
CN117216092A (en) | Method, device and equipment for optimizing TDSQL script and readable storage medium | |
CN113468251A (en) | DB2 data query result processing method and device | |
CN108388589B (en) | Device for automatically generating sql query statement of database |
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 |