Query utilization device, view information generation method, and program

The query utilization device addresses the complexity of database searches by automatically generating a meta model from existing SQL, enabling users to perform searches without mastering complex queries, thus simplifying information retrieval and reducing development and maintenance efforts.

WO2024219508A1PCT designated stage Publication Date: 2024-10-24INFORMEX
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2024/016943
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

Conventional database search systems require users to master complex SQL queries, which is difficult due to the increasing sophistication and complexity of database operations, leading to high man-hours for development and maintenance, and limitations in handling advanced search functions and multi-database queries.

Method used

A query utilization device that automatically generates a 'meta model' by collecting and standardizing existing SQL, allowing users to perform searches through a standardized interface, reducing the need for complex queries and enabling easier handling of advanced search functions and multi-database queries.

Benefits of technology

This solution reduces the burden of developing and maintaining SQL queries, allows users without extensive knowledge to utilize the system, and facilitates efficient handling of complex searches across multiple databases, thereby simplifying information retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2024016943_24102024_PF_FP_ABST
    Figure JP2024016943_24102024_PF_FP_ABST
Patent Text Reader

Abstract

[Problem] It has been necessary to use complex SQL queries or the like to obtain necessary information. [Solution] It is possible to easily obtain necessary information, without using complex queries, by means of a query utilization device 1 that: acquires, for each of two or more queries, an object definition having two or more sets of object information including an object name and a table name from the query; acquires a combined object definition in which the object information from two or more object definitions has been made unique; accumulates combined object definitions; acquires, for each of two or more queries, a joined table definition having a reference table name and one or more set of joined table information having the table names of a join operation from the queries; and acquires, from two or more joined table definitions, a combined table definition having one or more sets of joined table information in which two or more sets of joined table information paired with the same reference table name have been made unique.
Need to check novelty before this filing date? Find Prior Art

Description

Query using device, view information producing method, and program

[0001] The present invention relates to a query utilization device that utilizes a set of queries such as SQL to search for information.

[0002] Conventionally, there has been a device that provides information in a database in a differentiated manner according to the level of access rights of a user who wishes to search the information (see Patent Document 1).

[0003] Japanese Patent Application Publication No. 10-27124

[0004] However, in the prior art, a user may need to master complex queries such as SQL to obtain necessary information, but it is not easy to master complex queries.

[0005] More specifically, many types of databases, including relational databases, use SQL as their standard operating language. SQL was initially developed as a high-level language to meet operational requirements for databases. However, operational requirements for databases (particularly search requests) have since become more sophisticated and complex, and today there are SQL commands that can contain thousands or even tens of thousands of steps, making it increasingly difficult to understand, develop, and maintain SQL.

[0006] For example, various tools have been developed, such as SQL modeling tools to support database development, and BI (Business Intelligence) tools that have a GUI to visualize database structures and support database searches. However, while these tools are effective for databases with relatively simple structures and simple business requirements, as databases become larger and more complex, the tools' capabilities exceed their limits, and the current situation is that large amounts of SQL are being produced and managed in system development sites.

[0007] Furthermore, in order to deal with the complexity of data that systems and tools cannot fully handle, to deal with exceptions, and to respond to new business requirements that were not initially anticipated, data users typically spend a great deal of time performing additional data processing using methods such as EUC (end user computing).

[0008] The above problem can be solved by having users not directly operate SQL, a database manipulation language, but by preparing a "metamodel" in advance that patterns and standardizes search requests for databases, allowing users to make search requests to this "metamodel" and receive search results that satisfy the search request based on the metamodel.

[0009] On the other hand, tools that aim to improve the efficiency of database searches by developing and introducing new "metamodels" are already in practical use under names such as "virtual databases" and "data integration search tools."

[0010] This invention relates to a technology that automatically generates a "metamodel" by collecting existing SQL statements used in system development and system usage, and patterning or standardizing them. This technology makes it possible to easily migrate existing database search systems to search systems that use the "metamodel."

[0011] The introduction of a "metamodel" allows SQL components to be standardized or patterned, modularized, and SQL to be automatically generated each time it is executed, resulting in the following benefits: First, the man-hours required to develop new SQL can be reduced by reusing similar existing components and developing only the new or changed parts. Second, the maintenance burden is reduced when maintaining or modifying SQL, as the overall number of steps that need to be managed is reduced and the scope of changes can be limited.

[0012] Furthermore, the introduction of a "metamodel" makes it possible to support advanced functions that cannot be achieved with conventional SQL alone. First, it makes it easy to support searches across multiple databases and searches that mix different patterns of algorithms, which are difficult to do with a single SQL. Second, it makes it possible to manage information that is not supported by SQL, such as information related to user operation support, navigation, and security constraints.

[0013] Furthermore, by automatically generating the "metamodel," it becomes possible to introduce the "metamodel" easily and quickly. As a result, firstly, even users without sufficient knowledge and skills in design and development can utilize the "metamodel." Secondly, even users who already have a large amount of SQL assets and require a great deal of man-hours for development and maintenance can easily migrate to the "metamodel." Thirdly, automatic generation makes it possible to standardize and stabilize the quality of the "metamodel," making subsequent system operation easier.

[0014] a query utilization device comprising: a query acquisition unit that acquires two or more queries from a query storage unit in which two or more queries for tables in a database are stored; an object definition acquisition unit that acquires, for each of the two or more queries, an object definition having two or more pieces of object information from the query, the object name and the table name of a table in which an object identified by the object name is stored; a post-integrated object definition acquisition unit that acquires, from the two or more object definitions acquired by the object definition acquisition unit, an integrated object definition having one or more pieces of object information that make the object information held by the two or more object definitions unique; a post-integrated object definition storage unit that stores the post-integrated object definition; a joined table definition acquisition unit that acquires, for each of the two or more queries, a joined table definition having a reference table name that identifies a reference table from the query and one or more joined table pieces of information that have table names of two tables to be subjected to a join operation; a post-integrated table definition acquisition unit that acquires, from the two or more joined table definitions acquired by the joined table definition acquisition unit, an integrated table definition having one or more joined table pieces of information that make the two or more joined table pieces of information paired with the same reference table name unique; and a post-integrated table definition storage unit that stores the integrated table definition.

[0015] With this configuration, it is possible to acquire view information having integrated object definitions and integrated table definitions for easily obtaining required information without having to use complex queries.

[0016] Furthermore, in the query utilization device of the second invention, unlike the first invention, the object information includes a calculation definition formula, which is information for acquiring an object, and a category indicating whether the object is a key or not, and the object definition acquisition unit acquires the calculation definition formula and category from the query for each of two or more queries, and acquires an object definition having one or more object information having the calculation definition formula and the category.

[0017] With this configuration, it is possible to acquire an integrated object definition and an integrated table definition to easily obtain necessary information without having to use complex queries. Note that the integrated object definition and the integrated table definition can be considered to constitute view information.

[0018] Furthermore, the query utilization device of the third invention is a query utilization device that, compared to the first or second invention, further comprises a query reception unit that receives queries for integrated object definitions and integrated table definitions, a query execution unit that obtains the integrated object definitions and integrated table definitions for the queries received by the query reception unit and obtains execution results that satisfy the query using the query, integrated object definitions, and integrated table definitions, and an execution result output unit that outputs the execution results.

[0019] This configuration allows users to easily obtain the information they need without having to master complex queries.

[0020] Furthermore, in contrast to the first invention, the query utilization device of the fourth invention is a query utilization device in which the object information includes a calculation definition formula, which is information for acquiring an object, and a category indicating whether the object is a key or not, and further includes a post-integrated scope acquisition unit that acquires two or more integrated object definitions acquired by the post-integrated object definition acquisition unit, and acquires post-integrated scope information having one or more scope information each having an object name and one or more calculation definition formulas paired with the object name, which are owned by two or more integrated object definitions that have one or more key objects in common among the two or more integrated object definitions, and an post-integrated scope storage unit that stores the post-integrated scope information acquired by the post-integrated scope acquisition unit.

[0021] With this configuration, necessary information can be easily obtained.

[0022] Furthermore, the query utilization device of the fifth invention is a query utilization device that, compared to the fourth invention, further comprises a query reception unit that receives a query for a scope specified by the integrated scope information, a query execution unit that acquires the integrated scope information and the integrated table definition for the query received by the query reception unit, and uses the query, the integrated scope information, and the integrated table definition to obtain an execution result that is satisfied by the query, and an execution result output unit that outputs the execution result.

[0023] With this configuration, necessary information can be easily obtained.

[0024] Furthermore, a query utilization device according to a sixth aspect of the present invention is a query utilization device according to any one of the first to fifth aspects of the present invention, wherein the two or more queries in the query storage unit are queries for at least two or more different databases.

[0025] With this configuration, necessary information based on two or more databases can be easily obtained.

[0026] According to the query utilization device of the present invention, it is possible to easily obtain necessary information without having to master complex queries.

[0027] FIG. 1 is a conceptual diagram of an information system A in embodiment 1; FIG. 2 is a block diagram of the information system A; FIG. 3 is a block diagram of the query utilization device 1; FIG. 4 is a diagram showing an example of a query; FIG. 5 is a diagram showing an example of an object definition; FIG. 6 is a diagram showing an example of a joined table definition; FIG. 7 is a diagram showing an example of an integrated object definition, etc.; FIG. 8 is a diagram showing an example of an integrated table definition, etc.; FIG. 9 is a diagram showing an example of integrated scope information, etc.;

[0028] Hereinafter, embodiments of a query using device and the like will be described with reference to the drawings. Note that components with the same reference numerals in the embodiments perform similar operations, and therefore repeated description may be omitted.

[0029] First Embodiment In this embodiment, a query using device that generates a view based on two or more tables from a set of queries such as SQL will be described.

[0030] In this embodiment, a query using device capable of making a query on a generated view will be described.

[0031] In this embodiment, a query use device that generates a scope from two or more views will be described.

[0032] Furthermore, in this embodiment, a query using device capable of making a query to the generated scope will be described.

[0033] In this specification, information X being associated with information Y means that information Y can be obtained from information X, or information X can be obtained from information Y, and the method of association is not important. Information X and information Y may be linked, may exist in the same buffer, information X may be included in information Y, or information Y may be included in information X, etc.

[0034] Furthermore, in this specification, selecting or determining information Z means obtaining information Z, obtaining a pointer to information Z, obtaining the ID of information Z, setting a flag on information Z, etc., and it is sufficient if information Z can be accessed.

[0035] 1 is a conceptual diagram of an information system A according to this embodiment. The information system A includes a query use device 1, one or more terminal devices 2, and one or more database devices 3.

[0036] The query usage device 1 is a device that can generate views and scopes from a set of queries and query the views and scopes. It is preferable that the query usage device 1 is a server. The query usage device 1 is, for example, a cloud server or an ASP server, but the type is not important. The query usage device 1 may also be a terminal. If the query usage device 1 is a terminal, the information system A does not require a terminal device 2. If the query usage device 1 is a terminal, it can be considered that the query usage device 1 also serves as the terminal device 2. If the query usage device 1 is a terminal, the query usage device 1 is, for example, a so-called personal computer, smartphone, or tablet terminal, but the type is not important.

[0037] The terminal device 2 is a terminal used by a user. The user is a person who uses the query use device 1 or a person who searches the database device 3. The terminal device 2 is, for example, a personal computer, a smartphone, or a tablet terminal, but the type is not important.

[0038] The database device 3 is a device having a database function. The database device 3 is a device that receives a query such as SQL, executes the query, and transmits the execution result to the terminal device 2. The database device 3 is typically a server. However, the database device 3 may also be provided in the query use device 1.

[0039] 2 is a block diagram of an information system A according to this embodiment, and FIG. 3 is a block diagram of a query utilization device 1.

[0040] The query use device 1 includes a storage unit 11, a reception unit 12, a processing unit 13, and an output unit 15. The storage unit 11 includes a query storage unit 111. The reception unit 12 includes a query reception unit 121. The processing unit 13 includes a query acquisition unit 131, an object definition acquisition unit 132, a joined table definition acquisition unit 133, a post-integrated object definition acquisition unit 134, a post-integrated object definition storage unit 135, a post-integrated table definition acquisition unit 136, a post-integrated table definition storage unit 137, a post-integrated scope acquisition unit 138, a post-integrated scope storage unit 139, and a query execution unit 140. The output unit 15 includes an execution result output unit 151.

[0041] The terminal device 2 includes a terminal storage unit 21 , a terminal reception unit 22 , a terminal processing unit 23 , a terminal transmission unit 24 , a terminal reception unit 25 , and a terminal output unit 26 .

[0042] Various types of information are stored in the storage unit 11 that constitutes the query use device 1. The various types of information are, for example, queries, which will be described later.

[0043] The query storage unit 111 stores two or more queries. The queries here are typically SQL statements, but may be other types of information. The queries are query statements for tables in a database. The queries here are, for example, query statements for one or more database devices 3. The queries are typically character strings for searching a database. For example, the queries are Select statements (search statements). It is preferable that the queries have information indicating a join operation. For example, the information indicating a join operation is the character strings "JOIN" and "INNER JOIN". It is preferable that the queries in the query storage unit 111 are queries actually used by the user.

[0044] The query in the query storage unit 111 is, for example, information acquired from the database device 3 .

[0045] The receiving unit 12 receives various instructions and information, such as a query, a query acquisition instruction, and a scope acquisition instruction.

[0046] The query acquisition instruction is an instruction to acquire a query from one or more database devices 3 .

[0047] The scope acquisition instruction is an instruction to acquire view information (to be described later) and integrated scope information (to be described later) using one or more queries in the query storage unit 111 .

[0048] Here, "reception" typically refers to the reception of information transmitted via a wired or wireless communication line, but may also be a concept that includes the reception of information input from an input device such as a keyboard, mouse, or touch panel, or the reception of information read from a recording medium such as an optical disk, magnetic disk, or semiconductor memory.

[0049] The query reception unit 121 receives a query. The query is, for example, SQL, but may be a query other than SQL. The query reception unit 121 receives, for example, a query for a view. The query reception unit 121 receives, for example, a query for a scope.

[0050] A view is associated with, for example, a view identifier that identifies the view. A view is specified, for example, by an integrated table definition, which will be described later. A view is specified, for example, by an integrated table definition, which will be described later, and an object definition, which will be described later. A view may also be called a search view. Information that specifies the contents of a view is called view information. The view information includes an object definition, which will be described later, and a joined table definition, which will be described later.

[0051] A scope is information made up of two or more views. A scope is associated with, for example, a scope identifier that identifies the scope. A scope is specified, for example, by integrated scope information, which will be described later. A scope usually corresponds to two or more views. Note that a scope can also be considered a view. Information that specifies the contents of a scope is called integrated scope information. Integrated scope information has one or more pieces of scope information. Scope information has an object name and one or more calculation definition expressions. Such calculation definition expressions correspond to view information.

[0052] The processing unit 13 performs various types of processing, such as processing performed by a query acquisition unit 131, an object definition acquisition unit 132, and the like.

[0053] The query acquisition unit 131 acquires two or more queries from the query storage unit 111. These queries are used to acquire view information and integrated scope information.

[0054] The object definition acquisition unit 132 acquires an object definition for each of the two or more queries.

[0055] An object definition is a collection of information about one or more objects. An object can also be said to be an attribute value. An object definition has one or more pieces of object information.

[0056] The object information is information about an object. The object information includes an object name and a table name. The object information preferably includes a calculation definition formula and a category.

[0057] An object name is the name of an object. An object name is usually an attribute name. An object name may also be an object ID.

[0058] The table name is the name of the table in which the object identified by the object name is stored. The table name may also be the table ID.

[0059] A calculation definition formula is information for acquiring an object. A calculation definition formula is information for acquiring an attribute value. A calculation definition formula corresponds to an object name. A calculation definition formula is, for example, a "table name and object name", or an arithmetic formula. The arguments of an arithmetic formula are, for example, a "table name and object name". An arithmetic formula is an arithmetic formula for an object, such as "SUM", "AVERAGE", or an arithmetic operation. A calculation definition formula may also be called object acquisition source information.

[0060] The category is information that indicates whether an object is a key or not. The category is, for example, "key" or "data". "Key" indicates that the object is a key. "Data" indicates that the object is not a key.

[0061] For each of the two or more queries acquired by the query acquisition unit 131, the object definition acquisition unit 132 acquires an object definition having one or more pieces of object information from the query. The object definition acquisition unit 132 acquires the object name and the table name, for example, from a selection list (which may also be called a "projection list") of an SQL statement. The selection list is, for example, the character string following the character string "SELECT" and preceding the character string "GROUP BY" or "WHERE." The object definition acquisition unit 132 acquires, for example, two or more pairs of object names and table names from the selection list of the SQL statement. For example, the object definition acquisition unit 132 acquires pairs of object names and table names from character strings included in arithmetic expressions (e.g., "SUM" or "AVERAGE") from the selection list of the SQL statement. For example, the object definition acquisition unit 132 acquires the object name following the character string "AS" that corresponds to the arithmetic expression (for example, "SUM" or "AVERAGE") from the selection list of the SQL statement.

[0062] The object definition acquisition unit 132 preferably acquires a calculation definition expression from each of two or more queries and acquires an object definition having one or more pieces of object information that also have the calculation definition expression. The object definition acquisition unit 132 acquires the calculation definition expression from, for example, a selection list of an SQL statement.

[0063] Preferably, the object definition acquisition unit 132 acquires the category of each object from each of two or more queries, and acquires an object definition having information about one or more objects that also have that category. The object definition acquisition unit 132 acquires, for example, the object name of the key object from the GROUP BY clause of a SELECT statement, which is an SQL statement. Then, the object definition acquisition unit 132 acquires, for example, a category indicating whether or not the object is a key, associated with each object name. Note that the object name that appears in the GROUP BY clause is the name of the key object. The object name that does not appear in the GROUP BY clause is the name of the non-key object.

[0064] For example, the object definition acquisition unit 132 acquires the object names "Customer Code," "Customer Name," "Order Quantity," and "Order Amount" from the selection list of the SQL command (Search 1), which is the query in Fig. 4. Furthermore, from the selection list of the SQL command (Search 1) in Fig. 4, the object definition acquisition unit 132 acquires the table names "Order," "Customer," "Order Details," and "Order Details" corresponding to each of the four object names ("Customer Code," "Customer Name," "Order Quantity," and "Order Amount"). Furthermore, from the selection list, the object definition acquisition unit 132 acquires the calculation definition formulas "Order.Customer Code," "Customer.Customer Name," "SUM(Order Details.Quantity)," and "SUM(Order Details.Unit Price * Order Details.Quantity)" corresponding to each of the four object names.

[0065] Furthermore, the object definition acquisition unit 132 acquires, for example, the object names "Customer Code" and "Customer Name" of the objects that are keys from the GROUP BY clause of the query in Fig. 4. Next, the object definition acquisition unit 132 acquires the category "Key" in association with the object names "Customer Code" and "Customer Name", and acquires the category "Data" in association with other object names "Order Quantity" and "Order Amount". The category "Data" indicates that the object in question is not a key.

[0066] Through the above processing, the object definition acquisition unit 132 can acquire the object definition shown in Fig. 5. The object definition shown in Fig. 5 has four pieces of object information.

[0067] The joined table definition acquisition unit 133 acquires a joined table definition for each of two or more queries. The joined table definition acquisition unit 133 acquires the joined table definition from, for example, the FROM clause of a SELECT statement. The joined table definition acquisition unit 133 acquires the joined table definition using, for example, a clue clause that is a specific character string (e.g., "JOIN," "INNER JOIN," "INNER JOIN ... ON") in the FROM clause of the SELECT statement.

[0068] A join table definition is information about a join operation, and includes a reference table name and information about one or more join tables.

[0069] The joined table information includes the table names of the two tables to be joined, as well as a join type and a join condition expression, for example.

[0070] The reference table name is the name of the reference table. The reference table is the table that is located at the top of the join operation between the tables to be searched and has no further join sources. The reference table name is, for example, the first table identifier in the FROM clause of the SELECT statement.

[0071] The join table definition acquisition unit 133 acquires the join table definition of Fig. 6 from the query of Fig. 4, for example. The join table definition of Fig. 6 is information having two records each having a "superordinate table," a "joined table," a "join type," and a "join condition expression." The "superordinate table" and "joined table" are the names of the two tables that are the targets of the join operation. The name of the join table that pairs the "superordinate table" with (BASE), "Order Details," is the name of the base table.

[0072] The join type is information indicating the type of join operation. The join type is an instruction indicating the join operation. Examples of join types are "INNER JOIN", "LEFT JOIN", "RIGHT JOIN", and "FULL OUTER JOIN".

[0073] A join condition expression is information that indicates the condition of a join operation. For example, a join condition expression is "Order Detail.Order Code = Order.Order Code" or "Order.Customer Code = Customer.Customer Code."

[0074] The integrated object definition acquisition unit 134 acquires an integrated object definition from the two or more object definitions acquired by the object definition acquisition unit 132 .

[0075] An integrated object definition is information obtained by integrating two or more object definitions. An integrated object definition is information that has one or more pieces of object information that make the object information held by each of the two or more object definitions unique. An integrated object definition is also an example of an object definition. Like an object definition, an integrated object definition also has one or more pieces of object information.

[0076] The integrated object definition acquisition unit 134 acquires, from the two or more object definitions acquired by the object definition acquisition unit 132, an integrated object definition having one or more pieces of object information that make the object information held by the two or more object definitions unique.

[0077] For example, if there are three object definitions (FIGS. 7(a), (b), and (c)) acquired by the object definition acquisition unit 132, the integrated object definition acquisition unit 134 acquires the integrated object definition of FIG. 7(d) from the three object definitions. In FIG. 7(d), overlapping object information among the object information held by FIG. 7(a), (b), and (c) is consolidated into one.

[0078] The integrated object definition storage unit 135 stores the integrated object definition acquired by the integrated object definition acquisition unit 134. Note that the storage destination of the integrated object definition is not limited.

[0079] The integrated table definition acquisition unit 136 acquires an integrated table definition having one or more pieces of joined table information that are unique from two or more pieces of joined table information that are paired with the same reference table name, from two or more joined table definitions acquired by the joined table definition acquisition unit 133.

[0080] An integrated table definition is information obtained by integrating two or more joined table definitions. An integrated table definition is also an example of a joined table definition. Like a joined table definition, an integrated table definition also has a reference table and one or more joined table information. An integrated table definition also has, for example, a join type and a join condition expression.

[0081] 8(a), (b), and (c), the integrated table definition acquisition unit 136 acquires the integrated table definition of FIG. 8(d) from the three integrated table definitions with the same reference table name. In the integrated table definition (FIG. 8(d)), the joined table information that is a duplicate record in FIG. 8(a), (b), and (c) is processed to be unique.

[0082] The integrated table definition storage unit 137 stores the integrated table definition acquired by the integrated table definition acquisition unit 136. Note that the integrated table definition may be stored in any location.

[0083] The post-integration scope acquisition unit 138 acquires post-integration scope information from two or more post-integration object definitions that have one or more key objects in common, out of the two or more post-integration object definitions acquired by the post-integration object definition acquisition unit 134.

[0084] The post-integration scope acquisition unit 138 acquires two or more post-integration object definitions acquired by the post-integration object definition acquisition unit 134. Next, the post-integration scope acquisition unit 138 determines, from the two or more post-integration object definitions, two or more post-integration object definitions that have one or more key objects in common. Next, the post-integration scope acquisition unit 138 acquires one or more pieces of scope information that have object names included in the two or more determined post-integration object definitions and one or more calculation definition expressions that pair with the object names. Next, the post-integration scope acquisition unit 138 configures post-integration scope information that includes the one or more pieces of scope information. Note that in the post-integration scope information, if two or more post-integration object definitions have the same object name, they are integrated into one.

[0085] The integrated scope information can be said to be information that defines a view based on two or more views. The integrated scope information corresponds to two or more pieces of view information. The scope information has an object name and a calculation definition formula corresponding to one or more views for obtaining an object (attribute value) corresponding to the object name.

[0086] When two integrated object definitions ("search view 1" and "search view 2") in Figures 9(a) and 9(b) exist, the integrated scope acquisition unit 138 acquires the integrated scope information in Figure 9(c) from the two integrated object definitions. The integrated scope information in Figure 9(c) corresponds to "search view 1" and "search view 2." In the integrated scope information, duplicate object names in Figures 9(a) and 9(b) are made unique. Note that the underlined object names in Figures 9(a), 9(b), and 9(c) are the names of objects that serve as "keys."

[0087] The integrated scope storage unit 139 stores the integrated scope information acquired by the integrated scope acquisition unit 138. There is no restriction on where the integrated scope information is stored.

[0088] The integrated scope storage unit 139 stores the integrated scope information in association with two or more integrated object definitions (view information) that are the basis of the integrated scope information.

[0089] The query execution unit 140 obtains the integrated object definition and integrated table definition for the query received by the query reception unit 121, and uses the query, the integrated object definition, and the integrated table definition to obtain an execution result that satisfies the query.

[0090] The query execution unit 140, for example, acquires an integrated object definition and an integrated table definition for a query accepted by the query acceptance unit 121. For example, the query execution unit 140 acquires, from the integrated object definition, calculation definition expressions that are paired with one or more object names included in a search item (e.g., a selection list of an SQL statement) included in the query. The query execution unit 140 also acquires table names included in the acquired one or more calculation definition expressions. Next, the query execution unit 140 acquires, from the integrated table definition, reference table names included in the acquired one or more table names. The query execution unit 140 also acquires, from the integrated table definition, join condition expressions that are paired with joined tables and are included in the acquired one or more table names.

[0091] The query execution unit 140 acquires post-integration scope information and post-integration table definition for the query accepted by the query acceptance unit 121, and acquires an execution result that satisfies the query using the query, post-integration scope information, and post-integration table definition.

[0092] Specific examples of the processing performed by the query execution unit 140 will be described later with reference to the flowcharts of FIGS. 15 to 21.

[0093] The output unit 15 outputs various types of information, such as execution results and accepted queries.

[0094] Here, output means, for example, transmission to terminal device 2, but it may also be a concept that includes display on a display, projection using a projector, printing on a printer, sound output, transmission to an external device, storage on a recording medium, and handing over processing results to other processing devices or other programs.

[0095] The execution result output unit 151 outputs the execution result acquired by the query execution unit 140 .

[0096] Various types of information are stored in the terminal storage unit 21 of the terminal device 2. The various types of information are, for example, queries.

[0097] The terminal reception unit 22 receives various types of information, instructions, etc. The various types of information, instructions, etc. include, for example, a query, a query acquisition instruction, or a scope acquisition instruction. The input means for inputting the input information may be any means, such as a touch panel, a keyboard, a mouse, or a menu screen. It is preferable that the input means for inputting a query, etc. is a microphone.

[0098] The terminal processing unit 23 performs various types of processing. For example, the various types of processing are processing to convert received information, instructions, etc. into information, instructions, etc. with a structure to be transmitted. For example, the various types of processing are processing to convert received information into information with a structure to be output.

[0099] The terminal transmitting unit 24 transmits various types of information, instructions, etc. to the query use device 1. The various types of information, instructions, etc. are, for example, a query, a query acquisition instruction, or a scope acquisition instruction.

[0100] The terminal receiving unit 25 receives various types of information, such as execution results.

[0101] The terminal output unit 26 outputs various types of information, such as execution results.

[0102] The storage unit 11, the query storage unit 111, and the end storage unit 21 are preferably non-volatile recording media, but may also be realized as volatile recording media.

[0103] There is no restriction on the process by which information is stored in the storage unit 11 etc. For example, information may be stored in the storage unit 11 etc. via a recording medium, information transmitted via a communication line etc. may be stored in the storage unit 11 etc., or information input via an input device may be stored in the storage unit 11 etc.

[0104] The reception unit 12 and the query reception unit 121 are preferably realized by wireless or wired communication means, but may also be realized by a means for receiving broadcasts, a device driver for an input means such as a touch panel or keyboard, or control software for a menu screen.

[0105] The processing unit 13, query acquisition unit 131, object definition acquisition unit 132, join table definition acquisition unit 133, integrated object definition acquisition unit 134, integrated object definition storage unit 135, integrated table definition acquisition unit 136, integrated table definition storage unit 137, integrated scope acquisition unit 138, integrated scope storage unit 139, query execution unit 140, and terminal processing unit 23 can typically be realized by a processor, memory, etc. The processing procedures of the processing unit 13, etc. are typically realized by software, and the software is recorded on a recording medium such as a ROM. However, they may also be realized by hardware (dedicated circuit). The processor may be a CPU, MPU, GPU, etc., and the type does not matter.

[0106] The output unit 15 and the execution result output unit 151 are realized, for example, by wireless or wired communication means, but may also be realized by driver software for a display or speaker, or driver software for an output device and the output device, etc.

[0107] The terminal reception unit 22 can be realized by a device driver for an input means such as a touch panel or a keyboard, or control software for a menu screen.

[0108] The terminal transmitting unit 24 is usually realized by a wireless or wired communication means, but may also be realized by a broadcasting means.

[0109] The terminal receiving unit 25 is usually realized by a wireless or wired communication means, but may also be realized by a means for receiving broadcasts.

[0110] The terminal output unit 26 may or may not be considered to include an output device such as a display, a speaker, etc. The terminal output unit 26 may be realized by driver software for an output device, or by a combination of driver software for an output device and the output device, etc.

[0111] Next, an example of the operation of the query use device 1 will be described with reference to the flowchart of FIG.

[0112] (Step S1001) The reception unit 12 determines whether or not a query acquisition instruction has been received. If a query acquisition instruction has been received, the process proceeds to step S1002, and if not, the process proceeds to step S1012.

[0113] (Step S1002) The processing unit 13 assigns 1 to a counter i.

[0114] (Step S1003) The processing unit 13 determines whether or not the i-th database device 3 from which the query is to be acquired exists. If the i-th database device 3 exists, the processing proceeds to step S1004, and if not, the processing returns to step S1001.

[0115] (Step S1004) The processing unit 13 acquires from the i-th database device 3 one or more queries that have been executed in the past.

[0116] (Step S1005) The processing unit 13 assigns 1 to a counter j.

[0117] (Step S1006) The processing unit 13 determines whether or not the jth query is present among the queries acquired in step S1004. If the jth query is present, the process proceeds to step S1007; if not, the process proceeds to step S1011.

[0118] (Step S1007) The processing unit 13 acquires the j-th query from the queries acquired in step S1004.

[0119] (Step S1008) The processing unit 13 determines whether the query acquired in step S1007 matches the storage condition. If the query matches the storage condition, the process proceeds to step S1009. If the query does not match the storage condition, the process proceeds to step S1010.

[0120] The storage condition is a condition for storing a query. For example, the storage condition is that the query is a SELECT statement, or that the query is a SELECT statement and also performs a JOIN operation. The storage condition is usually a condition related to a specific character string (cue phrase) such as "SELECT" or "JOIN."

[0121] (Step S1009) The processing unit 13 stores the query acquired in step S1007 in the query storage unit 111.

[0122] (Step S1010) The processing unit 13 increments the counter j by 1. The process returns to step S1006.

[0123] (Step S1011) The processing unit 13 increments the counter i by 1. The process returns to step S1003.

[0124] (Step S1012) The reception unit 12 determines whether or not a scope acquisition instruction has been received. If a scope acquisition instruction has been received, the process proceeds to step S1013, and if not, the process proceeds to step S1020.

[0125] (Step S1013) The processing unit 13 assigns 1 to the counter i.

[0126] (Step S1014) The query acquisition unit 131 determines whether or not the i-th query exists in the query storage unit 111. If the i-th query exists, the process proceeds to step S1015; if not, the process proceeds to step S1017.

[0127] (Step S1015) The processing unit 13 analyzes the i-th query in the query storage unit 111. An example of such analysis processing will be described with reference to the flowchart of FIG.

[0128] (Step S1016) The processing unit 13 increments the counter i by 1. The process returns to step S1014.

[0129] (Step S1017) The integrated table definition acquisition unit 136 acquires the integrated table definition. An example of such integrated table acquisition processing will be described with reference to the flowchart of FIG.

[0130] (Step S1018) The integrated object definition acquisition unit 134 acquires the integrated object definition. An example of such integrated object acquisition processing will be described with reference to the flowchart of FIG.

[0131] (Step S1019) The integrated scope acquisition unit 138 acquires integrated scope information. Return to step S1001. An example of such integrated scope acquisition processing will be described with reference to the flowchart of FIG.

[0132] (Step S1020) Query receiving unit 121 determines whether or not a query has been received from a user. If a query has been received, the process proceeds to step S1021; if not, the process returns to step S1001.

[0133] (Step S1021) Query execution unit 140 executes the query accepted in step S1020 and obtains the execution result. An example of such query execution processing will be described with reference to the flowchart of FIG.

[0134] (Step S1022) The execution result output unit 151 outputs the execution result acquired in step S1021. The process returns to step S1001.

[0135] In this step, the execution result output unit 151 transmits the execution result to the terminal device 2, for example.

[0136] In the flowchart of FIG. 10, the process ends when the power is turned off or an interrupt occurs to end the process.

[0137] Next, an example of the analysis process in step S1015 will be described with reference to the flowchart in Fig. 11. It is assumed that the query to be analyzed here is a SELECT statement in SQL.

[0138] (Step S1101) The joined table definition acquisition unit 133 acquires a FROM clause from a query.

[0139] (Step S1102) The joined table definition acquisition unit 133 acquires the reference table name from the FROM clause acquired in step S1101.

[0140] (Step S1103) The joined table definition acquisition unit 133 assigns 1 to a counter i.

[0141] (Step S1104) The join table definition acquisition unit 133 determines whether or not a character string indicating the i-th join operation exists in the FROM clause acquired in step S1101. If a character string indicating the i-th join operation exists, the process proceeds to step S1105; if not, the process proceeds to step S1111.

[0142] (Step S1105) The joined table definition acquisition unit 133 acquires the name of the parent table in the character string indicating the ith join operation in the FROM clause. Note that if the character string indicating the ith join operation in the FROM clause is "INNER JOIN ORDER ON (ORDER DETAIL.ORDER CODE = ORDER.ORDER CODE)," the parent table name is "ORDER DETAIL."

[0143] (Step S1106) The join table definition acquisition unit 133 acquires the join table name for the i-th join operation in the FROM clause. Note that if the character string indicating the i-th join operation in the FROM clause is "INNER JOIN ORDER ON (ORDER DETAIL.ORDER CODE = ORDER.ORDER CODE)," the join table name is "ORDER."

[0144] (Step S1107) The join table definition acquisition unit 133 acquires the join type from the character string indicating the i-th join operation in the FROM clause. If the character string indicating the i-th join operation in the FROM clause is "INNER JOIN ORDER ON (ORDER DETAIL.ORDER CODE = ORDER.ORDER CODE)," the join type is "INNER JOIN."

[0145] (Step S1108) The join table definition acquisition unit 133 acquires a join condition expression from the character string indicating the i-th join operation in the FROM clause. If the character string indicating the i-th join operation in the FROM clause is "INNER JOIN ORDER ON (ORDER DETAIL.ORDER CODE = ORDER.ORDER CODE)," the join condition expression is "ORDER DETAIL.ORDER CODE = ORDER.ORDER CODE."

[0146] (Step S1109) The joined table definition acquisition unit 133 generates joined table information including the upper table name, joined table name, join type, and join condition expression.

[0147] (Step S1110) The joined table definition acquisition unit 133 increments the counter i by 1. The process returns to step S1104.

[0148] (Step S1111) The join table definition acquisition unit 133 creates and stores a join table definition having a reference table name and one or more pieces of join table information.

[0149] (Step S1112) The object definition acquisition unit 132 acquires a selection list from the query.

[0150] (Step S1113) The object definition acquiring unit 132 acquires a GROUP BY clause from the query.

[0151] (Step S1114) The object definition acquiring unit 132 acquires a WHERE clause from the query.

[0152] (Step S1115) The object definition acquiring unit 132 assigns 1 to the counter i.

[0153] (Step S1116) The object definition acquisition unit 132 determines whether the i-th object name exists in the selection list. If the i-th object name exists, the process proceeds to step S1117; if not, the process proceeds to step S1125.

[0154] (Step S1117) The object definition acquiring unit 132 acquires the i-th object name in the selection list.

[0155] (Step S1118) The object definition acquiring unit 132 acquires, from the selection list, the table name that pairs with the i-th object name. Note that this table name may also be called a reference table name.

[0156] (Step S1119) The object definition acquisition unit 132 determines whether the i-th object name exists in the GROUP BY clause. If the i-th object name exists, the process proceeds to step S1120; if not, the process proceeds to step S1121.

[0157] (Step S1120) The object definition acquisition unit 132 sets the category paired with the i-th object name as a "key." Then, the process proceeds to step S1122.

[0158] (Step S1121) The object definition acquiring unit 132 sets the category paired with the i-th object name to "data."

[0159] (Step S1122) The object definition acquisition unit 132 acquires a calculation definition formula including the i-th object name in the selection list.

[0160] (Step S1123) The object definition acquisition unit 132 creates object information including the object name, the reference table, the category, and the calculation definition formula.

[0161] (Step S1124) The object definition acquisition unit 132 increments the counter i by 1. The process returns to step S1117.

[0162] (Step S1125) The object definition acquisition unit 132

[0163] Next, an example of the integrated table acquisition process in step S1017 will be described with reference to the flowchart in FIG.

[0164] (Step S1201) The integrated table definition acquisition unit 136 assigns 1 to a counter i.

[0165] (Step S1202) The integrated table definition acquisition unit 136 determines whether the i-th reference table name exists among the two or more joined table definitions being processed. If the i-th reference table name exists, the process proceeds to step S1203; if it does not exist, the process returns to the upper level process. Note that, here, the same reference table name is considered to be one reference table name.

[0166] (Step S1203) The integrated table definition acquisition unit 136 acquires a joined table definition having the i-th reference table name.

[0167] (Step S1204) The integrated table definition acquisition unit 136 determines whether two or more joined table definitions were acquired in step S1203. If two or more joined table definitions were acquired, the process proceeds to step S1205. If one joined table definition was acquired, the process proceeds to step S1210.

[0168] (Step S1205) The integrated table definition acquisition unit 136 outputs two or more joined table definitions.

[0169] (Step S1206) The integrated table definition acquisition unit 136 determines whether or not the selection of two or more joined table definitions to be integrated has been accepted. If the selection has been accepted, the process proceeds to step S1207; if not, the process returns to step S1206.

[0170] (Step S1207) The integrated table definition acquiring unit 136 acquires all joined table information contained in each of the two or more joined table definitions whose selections have been accepted.

[0171] (Step S1208) The integrated table definition acquisition unit 136 performs unique processing on the two or more pieces of joined table information acquired in step S1207, and acquires one or more pieces of joined table information.

[0172] (Step S1209) The integrated table definition accumulation unit 137 accumulates an integrated table definition having one or more pieces of joined table information and a reference table name acquired in step S1208.

[0173] (Step S1210) The integrated table definition acquisition unit 136 increments the counter i by 1. The process returns to step S1202.

[0174] Next, an example of the integrated object acquisition process in step S1018 will be described with reference to the flowchart in FIG.

[0175] (Step S1301) The integrated object definition obtaining unit 134 assigns 1 to a counter i.

[0176] (Step S1302) The integrated object definition acquisition unit 134 determines whether the i-th integrated table definition exists. If the i-th integrated table definition exists, the process proceeds to step S1303; if not, the process returns to the upper level process.

[0177] (Step S1303) The integrated object definition obtaining unit 134 assigns 1 to a counter j.

[0178] (Step S1304) The integrated object definition acquisition unit 134 determines whether or not the jth joined table that is the basis of the i-th integrated table definition exists. If the jth joined table exists, the process proceeds to step S1305; if not, the process proceeds to step S1307.

[0179] (Step S1305) The integrated object definition obtaining unit 134 obtains an object definition that is paired with the jth joined table that is the basis of the i-th integrated table definition.

[0180] (Step S1306) The integrated object definition obtaining unit 134 increments the counter j by 1. The process returns to step S1304.

[0181] (Step S1307) The integrated object definition acquisition unit 134 acquires all of the object information contained in each of the two or more object definitions acquired in step S1305, performs unique processing on the two or more pieces of object information, and acquires an integrated object definition containing one or more pieces of object information.

[0182] (Step S1308) The integrated object definition accumulation unit 135 accumulates the integrated object definition acquired in step S1307 in association with the i-th integrated table definition.

[0183] (Step S1309) The integrated object definition obtaining unit 134 increments the counter i by 1. The process returns to step S1302.

[0184] Next, an example of the integrated scope acquisition process in step S1019 will be described with reference to the flowchart in FIG.

[0185] (Step S1401) The integrated scope acquisition unit 138 assigns 1 to a counter i.

[0186] (Step S1402) The integrated scope acquisition unit 138 determines whether the i-th combination of two or more key objects exists. If the i-th combination exists, the process proceeds to step S1403; if not, the process returns to the upper level process.

[0187] (Step S1403) The integrated scope acquisition unit 138 acquires one or more integrated object definitions having two or more key objects corresponding to the i-th combination.

[0188] (Step S1404) The integrated scope acquisition unit 138 determines whether the integrated object definition acquired in step S1403 includes two or more integrated object definitions. If two or more integrated object definitions are included, the process proceeds to step S1405; if not, the process proceeds to step S1410.

[0189] (Step S1405) The integrated scope acquisition unit 138 outputs two or more integrated object definitions.

[0190] (Step S1406) The integrated scope acquisition unit 138 determines whether or not a user selection has been accepted from among the two or more integrated object definitions output in step S1405. If a selection has been accepted, the process proceeds to step S1407, and if a selection has not been accepted, the process returns to step S1406. Note that the selection here is a selection of two or more integrated object definitions.

[0191] (Step S1407) The integrated scope acquisition unit 138 combines two or more integrated object definitions corresponding to the selection in step S1406. Note that combining means constructing an integrated object definition that includes all of the object information that each of the two or more integrated object definitions has.

[0192] (Step S1408) The integrated scope acquisition unit 138 performs unique processing on the object information in the integrated object definition acquired in step S1407, and configures an integrated object definition consisting only of unique object information. Such integrated object definition configures integrated scope information.

[0193] (Step S1409) The integrated scope storage unit 139 stores the integrated scope information acquired in step S1408 in association with the two or more integrated object definitions that are the basis of the integrated scope information.

[0194] (Step S1410) The integrated scope acquisition unit 138 increments the counter i by 1. The process returns to step S1402.

[0195] Next, an example of the query execution process in step S1021 will be described with reference to the flowchart in FIG.

[0196] (Step S1501) The query execution unit 140 acquires the scope identifier or view identifier to be searched from the received query.

[0197] (Step S1502) The query execution unit 140 acquires one or more pairs corresponding to the scope identifier or view identifier acquired in step S1501. A pair is a combination of a join table definition and an object definition.

[0198] (Step S1503) Query execution unit 140 assigns 1 to counter i.

[0199] (Step S1504) The query execution unit 140 determines whether or not the i-th pair exists among the pairs acquired in step S1502. If the i-th pair exists, the process proceeds to step S1505; if not, the process proceeds to step S1509.

[0200] (Step S1505) The query execution unit 140 acquires the i-th pair of the joined table definition and the object definition.

[0201] (Step S1506) The query execution unit 140 constructs a query using the joined table definition and object definition acquired in step S1505. An example of such query construction processing will be described with reference to the flowchart of FIG.

[0202] (Step S1507) The query execution unit 140 executes the query constructed in step S1506 and obtains the execution result.

[0203] (Step S1508) Query execution unit 140 increments counter i by 1. The process returns to step S1504.

[0204] (Step S1509) Query execution unit 140 determines whether the sets acquired in step S1502 are two or more sets or one set. If there are two or more sets, the process proceeds to step S1510; if there is one set, the process returns to the upper-level process.

[0205] (Step S1510) Query execution unit 140 combines two or more execution results to obtain one execution result. This result combination process will be described with reference to the flowchart in FIG.

[0206] Next, an example of the query construction process in step S1506 will be described with reference to the flowchart in FIG.

[0207] (Step S1601) The query execution unit 140 acquires one or more search items included in the query. Note that a search item is information that identifies an object included in the execution result. It can be said that the search item includes the object name included in the selection list.

[0208] (Step S1602) Query execution unit 140 acquires the search conditions included in the query. Note that the search conditions can be said to be, for example, the WHERE clause of a SELECT statement in SQL.

[0209] (Step S1603) Query execution unit 140 constructs a selection list in the query. An example of such selection list construction processing will be described with reference to the flowchart in FIG.

[0210] (Step S1604) Query execution unit 140 constructs a FROM clause in the query. An example of such FROM clause construction processing will be described with reference to the flowchart in FIG.

[0211] (Step S1605) Query execution unit 140 constructs a WHERE clause in the query. An example of such WHERE clause construction processing will be described with reference to the flowchart in FIG.

[0212] (Step S1606) Query execution unit 140 constructs a GROUP BY clause in the query, and returns to the upper-level processing. An example of such GROUP BY clause construction processing will be described with reference to the flowchart in FIG.

[0213] Next, an example of the selection list construction process in step S1603 will be described with reference to the flowchart in FIG.

[0214] (Step S1701) The query execution unit 140 assigns 1 to a counter i.

[0215] (Step S1702) Query execution unit 140 determines whether or not the i-th search item exists in the query. If the i-th search item exists, the process proceeds to step S1703; if not, the process proceeds to step S1710.

[0216] (Step S1703) The query execution unit 140 acquires the i-th search item from the query.

[0217] (Step S1704) The query execution unit 140 determines whether or not an object name matching the i-th search item exists in the target object definition. If an object name matching the i-th search item exists, the process proceeds to step S1705; if not, the process proceeds to step S1709.

[0218] (Step S1705) The query execution unit 140 acquires, from the object definition, a calculation definition expression that is paired with the object name that matches the i-th search item.

[0219] (Step S1706) The query execution unit 140 determines whether the calculation definition formula acquired in step S1705 includes an arithmetic expression. If it does include an arithmetic expression, the process proceeds to step S1707, and if it does not include an arithmetic expression, the process proceeds to step S1708.

[0220] (Step S1707) The query execution unit 140 modifies the calculation definition formula using the object name that matches the i-th search item. For example, the query execution unit 140 acquires a calculation definition formula by adding "AS object name" to the calculation definition formula acquired in step S1705.

[0221] (Step S1708) The query execution unit 140 adds the calculation definition formula acquired in step S1705 or step S1707 to the selection list.

[0222] (Step S1709) Query execution unit 140 increments counter i by 1. The process returns to step S1702.

[0223] Next, an example of the FROM phrase construction process in step S1604 will be described with reference to the flowchart in FIG.

[0224] (Step S1801) The query execution unit 140 assigns 1 to a counter i.

[0225] (Step S1802) The query execution unit 140 determines whether or not the i-th calculation definition formula exists among the calculation definition formulas acquired in step S1705 of the selection list configuration process (FIG. 17). If the i-th calculation definition formula exists, the process proceeds to step S1803; if not, the process proceeds to step S1805.

[0226] (Step S1803) The query execution unit 140 acquires, from the joined table definition, the table name paired with the i-th calculation definition expression among the calculation definition expressions acquired in step S1705 of the selection list configuration process (FIG. 17).

[0227] (Step S1804) Query execution unit 140 increments counter i by 1. The process returns to step S1802.

[0228] (Step S1805) Query execution unit 140 performs unique processing on the one or more table names acquired in step S1803, and acquires one or more table names.

[0229] (Step S1806) The query execution unit 140 obtains the name of the higher-level table that is the reference source of the table from the table name obtained in step S1805 based on the joined table information, and repeats this process recursively to obtain the name of the reference table, which is the top-level table, and places it in the FROM clause.

[0230] (Step S1807) The query executing unit 140 assigns 1 to the counter j.

[0231] (Step S1808) The query execution unit 140 determines whether the jth table name exists from among the one or more table names obtained by excluding the reference table name from the table names acquired in step S1805. If the jth table name exists, the process proceeds to step S1809; if it does not exist, the process returns to the upper level process. At this time, if the table is an intermediate table used recursively in step S1806, the process also proceeds to step S1809.

[0232] (Step S1809) The query execution unit 140 acquires the join type and join condition paired with the j-th table name from the joined table definition.

[0233] (Step S1810) The query execution unit 140 uses the j-th table name and the join type and join condition acquired in step S1809 to construct a string of characters for the join operation, and places this string in the FROM clause.

[0234] The character string for the join operation is, for example, "join type jth table name and ON (join condition)".

[0235] (Step S1811) The query execution unit 140 increments the counter j by 1. The process returns to step S1808.

[0236] Next, an example of the WHERE clause construction process in step S1605 will be described with reference to the flowchart in FIG.

[0237] (Step S1901) Query execution unit 140 assigns 1 to counter i.

[0238] (Step S1902) The query execution unit 140 determines whether the i-th item name is present in the search conditions of the received query. If the i-th item name is present, the process proceeds to step S1903; if not, the process proceeds to step S1907.

[0239] (Step S1903) The query execution unit 140 acquires the i-th item name from the query.

[0240] (Step S1904) The query execution unit 140 acquires, from the object definition, a calculation definition formula that is paired with the object name that matches the i-th item name.

[0241] (Step S1905) The query execution unit 140 replaces the i-th item name in the search criteria with the calculation definition formula acquired in step S1904.

[0242] (Step S1906) Query execution unit 140 increments counter i by 1. The process returns to step S1902.

[0243] (Step S1907) Query execution unit 140 adds the character string "WHERE" before the search condition replaced in step S1905 to form a WHERE clause, and then returns to the upper-level process.

[0244] Next, an example of the GROUPBY clause construction process in step S1606 will be described with reference to the flowchart in FIG.

[0245] (Step S2001) Query execution unit 140 assigns 1 to counter i.

[0246] (Step S2002) Query execution unit 140 determines whether or not the i-th search item exists. If the i-th search item exists, the process proceeds to step S2003; if not, the process proceeds to step S2007.

[0247] (Step S2003) The query execution unit 140 acquires, from the object definition, a category paired with an object name that matches the i-th search item.

[0248] (Step S2004) Query execution unit 140 determines whether the category acquired in step S2003 is "key." If it is "key," the process proceeds to step S2005; if it is not "key," the process proceeds to step S2006.

[0249] (Step S2005) The query execution unit 140 acquires, from the object definition, a calculation definition expression that is paired with the object name that matches the i-th search item, and adds the calculation definition expression to the GROUP BY clause.

[0250] (Step S2006) Query execution unit 140 increments counter i by 1. The process returns to step S2002.

[0251] (Step S2007) The query execution unit 140 constructs a GROUP BY clause by adding the character string "GROUP BY" before the one or more calculation definition expressions added in step S2005, and then returns to the upper-level process.

[0252] Next, the result combining process in step S1510 will be described with reference to the flowchart in FIG.

[0253] (Step S2101) Query execution unit 140 acquires a common key among two or more views.

[0254] (Step S2102) The query execution unit 140 constructs a query for a join operation that includes one or more search items in the query in a selection list, with the condition that the attribute values ​​(object values) of the keys acquired in step S2101 match.

[0255] (Step S2103) Query execution unit 140 performs a join operation on two or more views using the query in step S2102, obtains the execution result, and returns to the upper-level process.

[0256] Below, a specific example of the operation of the query use device 1 in this embodiment when performing an information search will be described. Two specific examples will be described below.

[0257] (Specific Example 1) Now, assume that the view information shown in Fig. 22 has been accumulated in the storage unit 11 by the processing of the processing unit 13 described above in the query use device 1. The view identifier of the view information here is "search view 1." The view information is a set of an object definition (Fig. 22(a)) and a join table definition (Fig. 22(b)).

[0258] Then, for the "Search View 1," the user inputs the query "<Target> Search View 1 <Search Item> Customer Code, Customer Name, Product Code, Product Name, Sales Quantity, Sales Amount <Search Condition> Customer Code = 134" into the terminal device 2. Note that this query may also be an SQL statement "SELECT Customer Code, Customer Name, Product Code, Product Name, Sales Quantity, Sales Amount FROM Search View 1 WHERE Customer Code = 134."

[0259] Next, the terminal device 2 accepts the query and transmits the query to the query use device 1 .

[0260] Next, the query receiving unit 121 of the query use device 1 receives the query.

[0261] Then, the query execution unit 140 obtains the execution results as follows through the processing described using the flowcharts of FIGS.

[0262] That is, the query execution unit 140 acquires the search items "customer code, customer name, product code, product name, sales quantity, sales price" included in the query. The query execution unit 140 also acquires the search condition "customer code = 134" included in the query.

[0263] Next, the query execution unit 140, using the processing described using the flowchart in Figure 17, references the object definition (Figure 22(a)) based on the search items "customer code, customer name, product code, product name, sales quantity, sales amount" and constructs a selection list in the query (Figure 23(a)).

[0264] Furthermore, the query execution unit 140 constructs a FROM clause (FIG. 23(b)) in the query by the FROM clause construction process described using the flowchart in FIG.

[0265] Furthermore, the query execution unit 140 constructs a WHERE clause (FIG. 23(c)) in the query by the WHERE clause construction process described using the flowchart in FIG.

[0266] Furthermore, the query execution unit 140 constructs a GROUP BY clause (FIG. 23(d)) in the query by the GROUP BY clause construction process described using the flowchart in FIG.

[0267] Through the above processing, the query execution unit 140 can construct the query (SELECT statement) shown in Fig. 22. Next, the query execution unit 140 executes the SELECT statement shown in Fig. 22 and obtains the execution results based on the records in the tables "Order," "Customer," "Product," and "Order Detail."

[0268] Next, the execution result output unit 151 transmits the execution result to the terminal device 2 .

[0269] Next, the terminal device 2 receives and outputs the execution result.

[0270] (Specific Example 2) Now, suppose that, through the processing of the processing unit 13 described above, for example, a pair of object definition and join table definition shown in FIG. 22 ("search view 1") and a pair of object definition and join table definition shown in FIG. 24 ("search view 2") are stored in the storage unit 11.

[0271] Furthermore, it is assumed that the post-integration scope acquisition unit 138 integrates the object definitions of search view 1 and search view 2, and post-integration scope information is acquired and stored through the process described using the flowchart in Fig. 14 . This post-integration scope information is referred to as "scope 1." The post-integration scope information is shown in Fig. 9(c). Note that Fig. 9(c) corresponds to "search view 1" (Fig. 22) and "search view 2" (Fig. 24).

[0272] Then, for "Scope 1," the user inputs the query "<Target> Scope 1 <Search item> Product code, Product name, Sales quantity, Purchase amount, Gross profit amount = Sales amount - Purchase amount <Search condition> Product code = 1020" into the terminal device 2. Note that this query may also be an SQL statement "SELECT Product code, Product name, Sales quantity, Purchase amount, Gross profit amount = Sales amount - Purchase amount FROM Scope 1 WHERE Product code = 1020."

[0273] Next, the terminal device 2 accepts the query and transmits the query to the query use device 1 .

[0274] Next, the query receiving unit 121 of the query use device 1 receives the query.

[0275] Then, the query execution unit 140 obtains the execution results as follows through the processing described using the flowcharts of FIGS.

[0276] That is, the query execution unit 140 acquires "product code, product name, sales quantity, purchase amount, sales amount" from the search item "product code, product name, sales quantity, purchase amount, gross profit amount = sales amount - purchase amount" contained in the query. The query execution unit 140 also acquires the search condition "product code = 1020" contained in the query. The query execution unit 140 also acquires "search view 1" and "search view 2" associated with "scope 1" from the search target "scope 1" contained in the query.

[0277] Next, the query execution unit 140, using the processing described using the flowchart in Figure 17, references the object definition of search view 1 (Figure 22(a)) based on the search items "product code, product name, sales quantity, purchase price, sales price" and constructs a selection list in the query (Figure 25(A)(a)).

[0278] In addition, the query execution unit 140, through the processing described using the flowchart in Figure 17, references the object definition of search view 2 (Figure 24(a)) based on the search items "product code, product name, sales quantity, purchase price, sales price" and constructs a selection list in the query (Figure 25(B)(a)).

[0279] Furthermore, the query execution unit 140 constructs a FROM clause (FIGS. 25A and 25B) in the query for "search view 1" through the FROM clause construction process described using the flowchart in FIG.

[0280] Furthermore, the query execution unit 140 constructs a FROM clause (FIG. 25B(b)) in the query for "search view 2" by the FROM clause construction process described using the flowchart in FIG.

[0281] Furthermore, the query execution unit 140 constructs a WHERE clause (FIGS. 25A and 25C) in the query for "search view 1" through the WHERE clause construction process described using the flowchart in FIG.

[0282] Furthermore, the query execution unit 140 constructs a WHERE clause (FIGS. 25B and 25C) in the query for "search view 2" through the WHERE clause construction process described using the flowchart in FIG.

[0283] Furthermore, the query execution unit 140 constructs a GROUP BY clause (FIG. 25(A)(d)) in the query for "search view 1" by the GROUP BY clause construction process described using the flowchart in FIG.

[0284] Furthermore, the query execution unit 140 constructs a GROUP BY clause (FIG. 25(B)(d)) in the query for "search view 2" by the GROUP BY clause construction process described using the flowchart in FIG.

[0285] Through the above processing, the query execution unit 140 constructs a query for "search view 1" (FIG. 25A) and a query for "search view 2" (FIG. 25B).

[0286] Next, the query execution unit 140 executes the query (FIG. 25(A)) and obtains an execution result 1. The query execution unit 140 also executes the query (FIG. 25(B)) and obtains an execution result 2.

[0287] Next, the query execution unit 140 performs a join operation on execution result 1 and execution result 2 using the "product code" as a key, using the process described using the flowchart in Figure 21, and obtains an execution result that combines execution result 1 and execution result 2.

[0288] Next, the execution result output unit 151 transmits the execution result to the terminal device 2 .

[0289] Next, the terminal device 2 receives and outputs the execution result.

[0290] As described above, according to this embodiment, view information for easily obtaining required information can be acquired without having to master complex queries.

[0291] Furthermore, according to this embodiment, necessary information can be easily obtained without having to master complex queries.

[0292] The processing in this embodiment may be realized by software. This software may be distributed by software download or the like. This software may also be recorded on a recording medium such as a CD-ROM and distributed. This also applies to the other embodiments in this specification. The software that realizes the query utilization device 1 in this embodiment is the following program. In other words, this program causes a computer to function as: a query acquisition unit that acquires two or more queries for tables in a database from a query storage unit in which the two or more queries are stored; an object definition acquisition unit that acquires, for each of the two or more queries, an object definition having two or more pieces of object information from the query, the object name and the table name of the table in which the object identified by the object name is stored; a post-integrated object definition acquisition unit that acquires, from the two or more object definitions acquired by the object definition acquisition unit, a post-integrated object definition having one or more pieces of object information that make the object information held by the two or more object definitions unique; a post-integrated object definition storage unit that stores the post-integrated object definition; a joined table definition acquisition unit that acquires, for each of the two or more queries, a joined table definition having, from the query, a reference table name that identifies a reference table and one or more joined table pieces of information that have the table names of two tables to be subjected to a join operation; a post-integrated table definition acquisition unit that acquires, from the two or more joined table definitions acquired by the joined table definition acquisition unit, a post-integrated table definition having one or more joined table pieces of information that make two or more joined table pieces of information paired with the same reference table name unique; and a post-integrated table definition storage unit that stores the post-integrated table definition.

[0293] 26 shows the appearance of a computer that executes the programs described herein to realize the query utilization device 1 and the like according to the various embodiments described above. The above-described embodiments can be realized by computer hardware and a computer program executed thereon. FIG. 26 is an overview of this computer system 300, and FIG. 27 is a block diagram of the system 300.

[0294] In FIG. 26, a computer system 300 includes a computer 301 including a CD-ROM drive, a keyboard 302, a mouse 303, and a monitor 304.

[0295] 27, the computer 301 includes, in addition to a CD-ROM drive 3012, an MPU 3013, a bus 3014 connected to the CD-ROM drive 3012 etc., a ROM 3015 for storing programs such as a boot-up program, a RAM 3016 connected to the MPU 3013 for temporarily storing instructions for application programs and providing temporary storage space, and a hard disk 3017 for storing application programs, system programs, and data. Although not shown here, the computer 301 may further include a network card for providing connection to a LAN.

[0296] A program that causes computer system 300 to execute functions such as those of query utilization device 1 of the above-described embodiment may be stored on CD-ROM 3101, inserted into CD-ROM drive 3012, and then transferred to hard disk 3017. Alternatively, the program may be transmitted to computer 301 via a network (not shown) and stored on hard disk 3017. The program is loaded into RAM 3016 when executed. The program may also be loaded directly from CD-ROM 3101 or the network.

[0297] The program does not necessarily include an operating system (OS) or a third-party program that causes the computer 301 to execute functions such as the query utilization device 1 of the above-described embodiment. The program need only include instructions that call appropriate functions (modules) in a controlled manner to obtain the desired results. How the computer system 300 operates is well known, and a detailed description thereof will be omitted.

[0298] The computer that executes the program may be a single computer or a plurality of computers, that is, it may perform centralized processing or distributed processing.

[0299] Furthermore, in each of the above embodiments, it goes without saying that two or more communication means present in one device may be physically realized by one medium.

[0300] Furthermore, in each of the above embodiments, each process may be realized by centralized processing in a single device, or may be realized by distributed processing in a plurality of devices.

[0301] The present invention is not limited to the above-described embodiment, and various modifications are possible, and it goes without saying that these modifications are also included within the scope of the present invention.

[0302] As described above, the query use device 1 according to the present invention has the effect of enabling necessary information to be easily obtained without the need to master complex queries, and is useful as a server or the like that performs information searches.

Claims

a post-integrated object definition acquisition unit that acquires, from the two or more object definitions acquired by the object definition acquisition unit, a post-integrated object definition having one or more object information that makes the object information held by the two or more object definitions unique; a post-integrated object definition storage unit that accumulates the post-integrated object definitions; a joined table definition acquisition unit that acquires, for each of the two or more queries, a joined table definition having one or more joined table information having a reference table name that identifies a reference table from the query and two table names to be subjected to a join operation; a post-integrated table definition acquisition unit that acquires, from the two or more joined table definitions acquired by the joined table definition acquisition unit, a post-integrated table definition having one or more joined table information that makes two or more joined table information paired with the same reference table name unique; and a post-integrated table definition storage unit that accumulates the post-integrated table definitions.

2. A query utilization device as described in claim 1, wherein the object information includes a calculation definition formula, which is information for acquiring an object, and a category indicating whether the object is a key or not, and the object definition acquisition unit acquires, for each of the two or more queries, a calculation definition formula and a category from the query, and acquires the object definition having one or more object information having the calculation definition formula and category.

3. A query utilization device as described in claim 1 or claim 2, further comprising: a query receiving unit that receives a query for the integrated object definition and the integrated table definition; a query execution unit that obtains the integrated object definition and the integrated table definition for the query received by the query receiving unit, and obtains an execution result satisfied by the query using the query, the integrated object definition, and the integrated table definition; and an execution result output unit that outputs the execution result.

4. The query utilization device of claim 1, further comprising: a post-integration scope acquisition unit that acquires two or more post-integration object definitions acquired by the post-integration object definition acquisition unit, and acquires post-integration scope information having one or more scope information having object names and one or more calculation definition expressions paired with the object names, the object information including a calculation definition formula which is information for acquiring an object, and a category indicating whether the object is a key or not; and a post-integration scope storage unit that stores the post-integration scope information acquired by the post-integration scope acquisition unit.

5. A query utilization device as described in claim 4, further comprising: a query reception unit that receives a query for a scope specified by the post-integration scope information; a query execution unit that acquires the post-integration scope information and the post-integration table definition for the query received by the query reception unit, and acquires an execution result satisfied by the query using the query, the post-integration scope information, and the post-integration table definition; and an execution result output unit that outputs the execution result.

6. The query utilization device according to claim 1, wherein the two or more queries in the query storage unit are queries to at least two or more different databases.

7. A method for producing view information realized by a query acquisition unit, an object definition acquisition unit, a post-integrated object definition acquisition unit, a post-integrated object definition storage unit, a join table definition acquisition unit, a post-integrated table definition acquisition unit, and a post-integrated table definition storage unit, comprising: a query acquisition step in which the query acquisition unit acquires two or more queries for a table in a database from a query storage unit in which the two or more queries are stored; an object definition acquisition step in which the object definition acquisition unit acquires, for each of the two or more queries, an object definition having two or more object information from the query having an object name and a table name of a table in which an object identified by the object name is stored; a post-integrated object definition acquisition step in which the post-integrated object definition acquisition unit acquires, from the two or more object definitions acquired by the object definition acquisition unit, a post-integrated object definition having one or more object information that makes the object information held by the two or more object definitions unique; and a post-integrated object definition storage step in which the post-integrated object definition storage unit stores the post-integrated object definition. a joined table definition acquisition step in which the joined table definition acquisition unit acquires, for each of the two or more queries, a joined table definition having a base table name that identifies a base table from the query and one or more joined table information having table names of two tables to be joined; a post-integrated table definition acquisition step in which the integrated table definition acquisition unit acquires, from the two or more joined table definitions acquired by the joined table definition acquisition unit, a post-integrated table definition having one or more joined table information that makes unique two or more joined table information that pair with the same base table name; and a post-integrated table definition storage step in which the post-integrated table definition storage unit stores the post-integrated table definition.

8. A program for causing a computer to function as: a query acquisition unit that acquires two or more queries for a table in a database from a query storage unit in which the queries are stored; an object definition acquisition unit that acquires, for each of the two or more queries, an object definition having two or more object information from the query, the object name and the table name of a table in which an object identified by the object name is stored; a post-integrated object definition acquisition unit that acquires, from the two or more object definitions acquired by the object definition acquisition unit, a post-integrated object definition having one or more object information that makes the object information held by the two or more object definitions unique; a post-integrated object definition storage unit that accumulates the post-integrated object definitions; a joined table definition acquisition unit that acquires, for each of the two or more queries, a joined table definition having a reference table name that identifies a reference table from the query and one or more joined table information having table names of two tables to be subjected to a join operation; a post-integrated table definition acquisition unit that acquires, from the two or more joined table definitions acquired by the joined table definition acquisition unit, a post-integrated table definition having one or more joined table information that makes two or more joined table information paired with the same reference table name unique; and a post-integrated table definition storage unit that accumulates the post-integrated table definitions.

Citation Information

Patent Citations

  • Handling precomputed views

    JP2002510088A

  • Identifying join relationships based on transaction access patterns

    JP2018506775A

  • Efficient extraction of large data sets from a database

    US20200125566A1