JPH0934899A - Retrieval path output method and device - Google Patents

Retrieval path output method and device

Info

Publication number
JPH0934899A
JPH0934899A JP7185580A JP18558095A JPH0934899A JP H0934899 A JPH0934899 A JP H0934899A JP 7185580 A JP7185580 A JP 7185580A JP 18558095 A JP18558095 A JP 18558095A JP H0934899 A JPH0934899 A JP H0934899A
Authority
JP
Japan
Prior art keywords
column
search
name
key
columns
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP7185580A
Other languages
Japanese (ja)
Inventor
Takatoshi Hattori
孝俊 服部
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP7185580A priority Critical patent/JPH0934899A/en
Publication of JPH0934899A publication Critical patent/JPH0934899A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To decide a retrieval path automatically by referencing a column management table representing storage information of each column so as to decide a coupling state between columns thereby deciding a retrieval path from a key column to a retrieval object column name. SOLUTION: The device is provided with a column name input means 11, a column management table 16, a path decision means 10 and a decision result output means 13, and the retrieval path decision means 10, and the retrieval path decision means 10 is made up of a column management table input means 17, an inter-column coupling decision means 15 and a retrieval path decision means 12. When a retrieval path to retrieval where a column is stored in a database is found out, a key column name and a retrieval object column name being a key to retrieve a database are entered and a column management table representing storage information of each column is referenced, the coupling state between columns is decided and the retrieval path from the key column to the retrieval object column name is decided based on the decision result.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、検索経路出力方法
および装置に係り、特に、カラムが複数のテーブルに分
かれて存在するデータベースシステムにおいて、あるカ
ラムから他のカラムを検索する場合の検索経路を判定
し、出力する検索経路出力方法および装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a search path output method and apparatus, and more particularly to a search path for searching a column from another column in a database system in which columns are divided into a plurality of tables. The present invention relates to a search route output method and device for determining and outputting.

【0002】[0002]

【従来の技術】従来、データベース上の1つのカラムか
ら他のカラムを検索する経路検索装置として、特開平2
−144671がある。この方法は、カラムが複数のテ
ーブルに分かれて存在するデータベースにおいて、1つ
のカラムから他のカラムを検索する場合の検索経路を判
定する装置を提案している。
2. Description of the Related Art Hitherto, as a route search device for searching one column on a database for another column, Japanese Patent Laid-Open No. HEI-2 is disclosed.
There is -144671. This method proposes an apparatus for determining a search path when searching one column for another column in a database in which columns are divided into a plurality of tables.

【0003】この装置は、以下のような手順により1つ
のカラムから他のカラムへの検索経路を判定する。 入力装置から検索のキーとなるカラム(以下、キー
カラム)名、検索の目的となるカラム(以下、目的カラ
ム)名を入力する。 装置は各カラムが存在するテーブルのデータ(特開
平2−144671では「フィールド名表」と呼称)を
備えており、当該データからキーカラム及び目的カラム
が存在するテーブル名を検索する。 当該装置は、テーブル間の結合関係を示すデータ
(特開平2−144671では、「結合表」と呼称)を
備えており、で得たテーブル名に基づいてテーブル間
の結合関係を示すデータから検索経路を判定する。
This device determines a search path from one column to another column by the following procedure. From the input device, enter the name of the column (hereinafter, key column) that is the key of the search and the name of the column that is the target of the search (hereinafter, the target column). The apparatus is provided with data of a table in which each column exists (referred to as "field name table" in Japanese Patent Laid-Open No. 2-144671), and the table name in which the key column and the target column exist is searched from the data. The apparatus is provided with data (referred to as "join table" in Japanese Patent Laid-Open No. 2-144671) indicating the join relationship between the tables, and is searched from the data indicating the join relationship between the tables based on the table name obtained in Determine the route.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記従
来の方法は、キーカラムと目的カラムを入力するのみで
検索経路が自動的に判定されることを目的としている
が、テーブル間の結合関係を示すデータ(結合表)を作
成する部分が自動化されておらず、結合表は、人間が調
査して、予め登録しておく必要がある。
However, the above-mentioned conventional method aims to automatically determine the search path only by inputting the key column and the target column, but the data indicating the join relation between the tables is used. The part that creates the (join table) is not automated, and the join table must be researched by a person and registered in advance.

【0005】本発明は、上記の点に鑑みなされたもの
で、人間が検索経路を調べる手間を省き、自動的に検索
経路を判定することが可能な検索経路出力方法及び装置
を提供することを目的とする。
The present invention has been made in view of the above points, and it is an object of the present invention to provide a search route output method and apparatus capable of automatically determining a search route without the need for a human to check the search route. To aim.

【0006】[0006]

【課題を解決するための手段】図1は、本発明の原理を
説明するための図である。本発明は、テーブル上に登録
された各種の情報であるカラムが複数のテーブルに分散
して存在するデータベースシステムにおいて、該カラム
が該データベース中のどこに格納されているかを検索す
るための検索経路を見つける検索経路出力方法におい
て、データベースを検索するためのキーとなるキーカラ
ム名と検索対象のカラム名を入力し(ステップ1)、各
カラムの格納情報を示すカラム管理表を参照して、カラ
ム間の結合状態を判定し(ステップ2)、判定結果に基
づいてキーカラムから検索対象のカラム名への検索経路
を判定する(ステップ3)。
FIG. 1 is a diagram for explaining the principle of the present invention. The present invention, in a database system in which columns, which are various types of information registered on a table, are distributed over a plurality of tables, provides a search path for searching where the columns are stored in the database. In the search path output method to find, enter the key column name that is the key for searching the database and the column name of the search target (step 1), and refer to the column management table that shows the storage information for each column The combined state is determined (step 2), and the search path from the key column to the column name of the search target is determined based on the determination result (step 3).

【0007】また、本発明は、カラム間の結合情報を判
定する際に(ステップ2)、あるカラムXとカラムYが
n次結合関係(同一テーブル)に存在し、該カラムYと
カラムZが0次結合関係に存在する関係にあれば、カラ
ムXとカラムZは、0からn+1次の何れかの次数で結
合しているという論理を用いて、低い次数の結合判定結
果に基づいて高い次数の結合関係を判定する。
Further, according to the present invention, when determining connection information between columns (step 2), a column X and a column Y exist in an n-th order connection relationship (same table), and the columns Y and Z are If there is a 0th-order connection relationship, the logic that the column X and the column Z are connected at any order from 0 to n + 1 is used, and the higher order is determined based on the lower order connection determination result. Determine the connection relationship of.

【0008】図2は、本発明の原理構成図である。本発
明は、テーブル上に登録された各種の情報であるカラム
が複数のテーブルに分かれて存在するデータベースシス
テムにおいて、該データベースより該カラムを検索する
場合の検索経路を判定するための検索経路出力装置にお
いて、データベースを検索するためのキーとなるカラム
(以下、キーカラム)名、検索の目的となるカラム(以
下、目的カラム)名を入力するカラム名入力手段11
と、各カラムがどのテーブルに存在するかを管理するカ
ラム管理表16と、キーカラムから目的カラムへの検索
経路を判定する経路判定手段10と、経路判定手段10
の判定結果を出力する判定結果出力手段13とを具備
し、検索経路判定手段10は、カラム管理表を入力する
カラム管理表入力手段17と、カラム管理表16を参照
して、各カラムが他のカラムとどのテーブルを介して結
合しているかのカラム間の結合状態を判定し、所定のデ
ータ形式に変換して格納するカラム間結合判定手段15
と、カラム間結合判定手段15の結果に基づいてキーカ
ラムから目的カラムへの検索経路を判定する検索経路判
定手段12よりなる。
FIG. 2 is a diagram showing the principle of the present invention. The present invention relates to a search path output device for determining a search path when a column is searched from the database in a database system in which columns that are various types of information registered on the table are divided into a plurality of tables. In the column name input means 11 for inputting the name of a column (hereinafter, referred to as a key column) that is a key for searching the database and the name of a column that is a target of the search (hereinafter, a target column)
A column management table 16 for managing which table each column exists, a route determination means 10 for determining a search route from a key column to a target column, and a route determination means 10
The search path determination unit 10 refers to the column management table input unit 17 for inputting the column management table, and the column management table 16 to determine whether each column is different from the others. Inter-column join determination means 15 for determining the join state between the column and the column through which the table is joined, and converting the column into a predetermined data format for storage.
And the search path determination means 12 for determining the search path from the key column to the target column based on the result of the inter-column connection determination means 15.

【0009】また、上記のカラム間結合判定手段15
は、あるカラムXとカラムYがn次結合関係(同一テー
ブル)に存在し、該カラムYとカラムZが0次結合関係
に存在する関係にあれば、カラムXとカラムZは、0か
らn+1次の何れかの次数で結合しているという論理を
用いて、低い次数の結合判定結果に基づいて高い次数の
結合関係を判定する手段を含む。
Further, the inter-column coupling determination means 15 described above is used.
If a column X and a column Y exist in an nth-order connection relationship (same table) and the column Y and a column Z exist in a 0th order connection relationship, the columns X and Z are 0 to n + 1. It includes means for determining a high-order connection relation based on a low-order connection determination result by using the logic of connection with any of the following orders.

【0010】上記のように本発明は、カラム管理表入力
部17によりカラム管理表9を入力し、カラム間結合判
定部15においてカラム管理表16よりカラム間の結合
状態を判定し、所定の形式のデータに変換して、装置内
に格納しておく。結合状態の判定処理では、「カラムX
とカラムYがn次結合関係にあり、カラムYとカラムZ
が0次結合関係(同一データベースに存在する)にあれ
ば、カラムXとカラムZは、0〜n+1次のいずれかの
次数で繋がっている」ことを利用して低い次数の結合判
定結果に基づいて高い次数の結合関係を判定する仕組み
となっている。
As described above, according to the present invention, the column management table input unit 17 inputs the column management table 9, the inter-column connection determination unit 15 determines the connection state between columns from the column management table 16, and the predetermined format is determined. It is converted to the data of and stored in the device. In the combined state determination process, "Column X
And column Y have an nth-order connection relationship, and column Y and column Z
Is in a 0th-order connection relationship (existing in the same database), column X and column Z are connected by any order of 0 to n + 1 ”. It is a mechanism to judge the connection relation of high degree.

【0011】また、検索の際には、外部からキーカラム
名と目的カラム名を入力し、検索経路判定部では、カラ
ム間の結合情報を判定したデータを参照してキーカラム
から目的カラムに至る検索経路を判定し、検索経路出力
部よりその結果を出力する。これにより、カラムが複数
のテーブルに存在するデータベースシステムにおいて1
つのカラムから他のカラムへの検索経路を判定し、出力
することができる。
Further, at the time of the search, the key column name and the target column name are input from the outside, and the search path determination unit refers to the data for which the coupling information between the columns is determined and refers to the search path from the key column to the target column. Is determined and the result is output from the search path output unit. As a result, in a database system where columns exist in multiple tables, 1
The search path from one column to another can be determined and output.

【0012】[0012]

【発明の実施の形態】以下の説明の前に、説明中に使用
する用語、記法を定義する。 ・カラム:データベースのテーブル上に登録された各種
の情報 ・キーカラム:検索のキーとなるカラム ・目的カラム:検索の目的となるカラム ・カラム間のn次結合:カラム群X,Y,C1 〜Cn が
あって、XとC1 ,C1とC2 ,…Cn-1 とCn ,Cn
とYがそれぞれ同一テーブルにある場合、X,Yはn次
に結合していると呼ぶ。 ・中継カラム:X,YがC1 〜Cn を介してn次に結合
している場合、C1 〜Cn を中継カラムと呼ぶ。 ・中継テーブル:XとC1 がテーブルT1 にあり、C1
とC2 がテーブルT2 にあり、…Cn とYがテーブルT
n+1 にある場合、T1 〜Tn+1 をX,Y間の中継テーブ
ルと呼ぶ。 ・直前カラム:X,YがC1 〜Cn を介してn次に結合
しており、XとC1 ,C1 とC2 ,…,Cn-1 とCn 、
Cn とYが同一テーブルにある場合、Cn をXからYへ
の直前カラムと呼ぶ。 ・直前テーブル:XからYへの直前カラムとYを結ぶテ
ーブルをXからYへの直前テーブルを呼ぶ。
BEST MODE FOR CARRYING OUT THE INVENTION Prior to the following description, terms and notations used in the description will be defined. -Column: Various information registered in the database table-Key column: Column that is the key of the search-Object column: Column that is the object of the search-Nth-order coupling between columns: Column groups X, Y, C1 to Cn Therefore, X and C1, C1 and C2, ... Cn-1 and Cn, Cn
And Y are in the same table, X and Y are said to be connected to the nth order. -Relay column: When X and Y are coupled to the nth order through C1 to Cn, C1 to Cn are called a relay column. -Relay table: X and C1 are in table T1 and C1
And C2 are in table T2, ... Cn and Y are in table T
When it is n + 1, T1 to Tn + 1 are called a relay table between X and Y. Immediately preceding column: X and Y are bonded to the nth order through C1 to Cn, and X and C1, C1 and C2, ..., Cn-1 and Cn,
If Cn and Y are in the same table, Cn is called the previous column from X to Y. -Previous table: The table connecting the previous column from X to Y and Y is called the previous table from X to Y.

【0013】図3は本発明の検索経路出力装置の構成を
示す。同図に示す検索経路出力装置は、キーカラム及び
目的カラムの入力を行うカラム名入力部11、検索経路
を判定する経路判定部10、カラム管理表を経路判定部
10に入力するカラム管理表入力部17、検索経路出力
部13及び出力ファイル18より構成される。
FIG. 3 shows the configuration of the search path output device of the present invention. The search route output device shown in FIG. 1 includes a column name input unit 11 that inputs a key column and a target column, a route determination unit 10 that determines a search route, and a column management table input unit that inputs a column management table to the route determination unit 10. 17, a search path output unit 13 and an output file 18.

【0014】経路判定部10は、検索経路判定部12、
データベース中に存在する全てのカラムの組み合わせに
ついてのカラム間の結合状態に関するデータであるカラ
ム間結合データ14、カラム間結合判定部15、各カラ
ムがどのテーブルに存在するかを記録したデータである
カラム管理表16より構成される。
The route determination unit 10 includes a search route determination unit 12,
Inter-column join data 14, which is data relating to the inter-column join state for all combinations of columns that exist in the database, inter-column join determination unit 15, and columns that are data that records in which table each column exists It is composed of a management table 16.

【0015】上記の検索経路判定部12は、キーカラム
名、目的カラム名に基づいてカラム間結合データ14を
参照してキーカラムから目的カラムへの検索経路を判定
する。カラム間結合判定部15は、カラム管理表16に
基づいてカラム間の結合情報を判定し、カラム間結合デ
ータ14を生成する。
The search path determining unit 12 determines the search path from the key column to the target column by referring to the inter-column connection data 14 based on the key column name and the target column name. The inter-column connection determination unit 15 determines inter-column connection information based on the column management table 16 and generates inter-column connection data 14.

【0016】図4は、本発明のカラム管理表の構成を示
す。カラム管理表16は、表形式データの形をとってお
り、列見出しに記載されたテーブルTi が行見出し中の
カラムCj を含む場合には、(Cj ,Ti )欄にその旨
を示す記号(同図では○)が記載される。同図の例で
は、(C1 ,T1 ),(C2 ,T2 ),(C2 ,Tn
),(Cj ,Ti ),(Cn ,T1 ),(Cn ,T3
)に○印が付与されている。従って、テーブルT1 に
は、カラムC1 ,Cn が含まれ、テーブルT2 にはC2
が、テーブルT3 にはCn が、テーブルTi にはCj
が、テーブルTn にはC2がそれぞれ含まれている。
FIG. 4 shows the structure of the column management table of the present invention. The column management table 16 is in the form of tabular data, and if the table Ti described in the column heading includes the column Cj in the row heading, a symbol (Cj, Ti) indicating that ( In the figure, ○) is described. In the example of the figure, (C1, T1), (C2, T2), (C2, Tn
), (Cj, Ti), (Cn, T1), (Cn, T3)
) Is attached. Therefore, table T1 contains columns C1 and Cn and table T2 contains C2.
However, table T3 contains Cn, and table Ti contains Cj.
However, the table Tn contains C2.

【0017】図5は、本発明のカラム間結合データの構
成を示す。カラム間結合データ14は、カラム間結合判
定部15により生成されるデータである。同図の表の行
見出し欄には、キーカラム名、列見出し欄には、目的カ
ラム名が記載され、キーカラムXと目的カラムYの間の
結合データは(X,Y)欄に記載されることになる。
FIG. 5 shows the structure of inter-column connection data of the present invention. The inter-column connection data 14 is data generated by the inter-column connection determination unit 15. In the table of the figure, the key column name is described in the row heading column, the target column name is described in the column heading column, and the combined data between the key column X and the target column Y is described in the (X, Y) column. become.

【0018】各欄には、行見出し記載テーブルから列見
出し記載テーブルに至る直前テーブル、直前カラム、結
合次数が、 「結合次数−(直前テーブル名)−直前カラム名」 の形で記載される。例として、図5のテーブルのXの行
では、 X−(T1 )−C1 −(T2 )−C2 − … Cn −
(Tn+1 )−Y のようなカラムの繋がりを格納した例を示す。同図で
は、(X,Y)欄からYの直前カラムCn ,直前テーブ
ルTn+1 を読み取り、(X,Cn )欄からCn の直前カ
ラムCn-1 、直前テーブルTn を読み取る、という過程
を繰り返し、順に中継テーブル、カラムを検出できるよ
うになっている。なお、同図において、()内は中継テ
ーブルを示し、“−”と“−”の間は中継カラムを示
す。
In each column, the immediately preceding table from the row heading description table to the column heading description table, the immediately preceding column, and the join order are described in the form of "join order- (previous table name) -previous column name". As an example, in the row X of the table of FIG. 5, X- (T1) -C1- (T2) -C2 --... Cn-
An example in which a column connection such as (Tn + 1) -Y is stored is shown. In the figure, the process of reading the immediately preceding column Cn and the immediately preceding table Tn + 1 of Y from the (X, Y) column and reading the immediately preceding column Cn-1 and the immediately preceding table Tn of Cn from the (X, Cn) column are repeated. The relay table and column can be detected in sequence. In addition, in the same figure, the inside of () shows a relay table, and between "-" and "-" shows a relay column.

【0019】図6は、本発明のカラム間結合判定部の動
作を示すフローチャートである。まず、処理に先立ち結
合データ記録用として、カラム間結合データ14の表を
バッファ上に用意する。 ステップ101) カラム管理表入力部17がカラム管
理表16を経路判定部10に入力する。
FIG. 6 is a flow chart showing the operation of the inter-column coupling determination unit of the present invention. First, prior to processing, a table of inter-column combined data 14 is prepared on the buffer for recording combined data. Step 101) The column management table input unit 17 inputs the column management table 16 to the route determination unit 10.

【0020】ステップ102) 経路判定部10のカラ
ム間結合判定部15は、入力されたカラム管理表16に
基づいて、カラム間の0次結合関係を判定し、結果を結
合データ格納用の表であるカラム間結合データ14の所
定欄に記述する。 ステップ103) カラム間結合データ14の格納用の
表の最初の行に対応するカラムをXとする。
Step 102) The inter-column join decision unit 15 of the route decision unit 10 decides the 0th order join relation between columns based on the input column management table 16, and the result is stored in the join data storage table. It is described in a predetermined column of the inter-column connection data 14. Step 103) Let X be the column corresponding to the first row of the table for storing the inter-column combined data 14.

【0021】ステップ104) 次数カウント値kの初
期値を0とする。 ステップ105) Xとk次結合関係にあるカラムに基
づいてXとk+1次結合関係にあるカラムを判定し、判
定結果をカラム間結合データ14の表に書き込む。
Step 104) The initial value of the order count value k is set to 0. Step 105) A column having a k + 1th-order coupling relationship with X is determined based on a column having a kth-order coupling relationship with X, and the determination result is written in the table of inter-column coupling data 14.

【0022】ステップ106) Xとk+1次結合関係
にあるカラムが見つかったか否かを判定し、見つかった
場合にはステップ107に移行し、見つけられなかった
場合には、ステップ108に移行する。 ステップ107) X行に余白があるかを判定し、ある
場合には、kの値をインクリメントしてステップ105
に移行する。余白が無い場合には、ステップ108に移
行する。
Step 106) It is judged whether or not a column having a k + 1th order connection relationship with X is found. If found, the process goes to Step 107, and if not found, the process goes to Step 108. Step 107) It is determined whether or not there is a blank in the X row, and if there is a blank, the value of k is incremented and Step 105
Move to If there is no margin, the process proceeds to step 108.

【0023】ステップ108) カラム間結合データ1
4の表には、さらに下の行があるかを判定し、ある場合
には、ステップ109に移行し、下の行が存在しない場
合には、処理を終了する。 ステップ109) カラム間結合データ14の表の当該
行をXとする。
Step 108) Inter-column combined data 1
It is determined whether or not there is a lower row in the table of No. 4, and if there is a lower row, the process proceeds to step 109, and if there is no lower row, the process ends. Step 109) Let X be the relevant row in the table of inter-column combined data 14.

【0024】なお、上記のフローチャートのステップ1
05において、Xと何等かの形で結合しているすべての
カラムについて結合関係を判定してしまうと、Xと結合
関係にある新たなカラムを見つけることができなくなる
ため、ステップ106において、Xとk+1次結合関係
にあるテーブルが見つからない場合、すべてのカラムに
つき、結合関係を判定し尽くしたものと判断し、ステッ
プ105の処理を繰り返して処理を終了する。
Note that step 1 of the above flow chart
In 05, if the join relation is determined for all columns that are joined to X in some way, it is not possible to find a new column that has a join relation with X. If no table having a k + 1 primary join relation is found, it is determined that the join relations have been exhausted for all columns, and the process of step 105 is repeated to end the process.

【0025】次に、上記のステップ105の処理を詳細
に説明する。図7は、本発明のカラム間結合判定部の結
合関係判定処理を説明するための図である。同図に示す
カラム間結合データ14の表中の○内の番号と以下の説
明の番号は一致するものとし、同図中の“****”
は、2つのカラム間の接続関係が判定されていない状態
を示すものとする。
Next, the processing of the above step 105 will be described in detail. FIG. 7 is a diagram for explaining the connection relationship determination processing of the inter-column connection determination unit of the present invention. It is assumed that the numbers in circles in the table of the inter-column combined data 14 shown in the same figure and the numbers in the following description match, and "*****" in the figure.
Indicates that the connection relationship between the two columns has not been determined.

【0026】 Xとk結合関係にあるカラムCに着目
し、Cの名前を変数Cに格納する。 Cの行にアクセスする。 Cと0次結合関係にあるカラムW1〜W3に着目す
る。 XとW1〜W3の結合関係を調べる(同図では、W
1につきk−1次結合関係判定済)。W2,W3につい
ては、結合関係が未判定である。
Focusing on the column C having a k-joint relationship with X, the name of C is stored in the variable C. Access row C. Attention is paid to columns W1 to W3 that have a 0th-order coupling relationship with C. Check the connection between X and W1-W3 (in the figure, W
1) k-1 order connection relationship has been determined). With regard to W2 and W3, the connection relationship has not been determined.

【0027】 において、Xとの結合関係が未判定
のテーブルW2,W3について(C,W2),(C,W
3)のそれぞれの欄から「−()−」内テーブル名を読
み取り、配列Tに格納する。 でXとの結合関係が未判定のテーブルW2,W3
について(X,W2),(X,W3)欄に結合関係を記
載する。例えば、W2の場合は、 “k+1(配列TのW2に対応する要素の内容)−Cの
内容” という形で結合関係が記載されることになる。
In Tables (C, W2), (C, W) for the tables W2, W3 whose connection relationship with X has not been determined.
The table name in "-()-" is read from each column of 3) and stored in the array T. Tables W2 and W3 whose connection relationship with X is undetermined
For (), the bonding relationships are described in the (X, W2) and (X, W3) columns. For example, in the case of W2, the connection relation is described in the form of "k + 1 (content of element corresponding to W2 of array T) -content of C".

【0028】次に、検索経路判定部12がカラム間結合
データ14から検索経路を読み取る手順を説明する。図
8は、本発明の検索経路判定部の動作を示す。同図中の
○内の番号と以下の説明の番号は一致するものとする。
同図において、(a)はカラム間結合データを示し、
(b)は検索経路出力ファイル18の内容を示す。検索
経路判定部12は、カラム名入力部11よりキーカラム
X、目的カラムYが入力され、カラム間結合データ
(a)を参照して検索経路を読み取る。読み取った結果
を検索経路出力ファイル18(b)に書き込む。
Next, a procedure for the search path determination unit 12 to read the search path from the inter-column connection data 14 will be described. FIG. 8 shows the operation of the search route determination unit of the present invention. It is assumed that the numbers in the circles in the figure match the numbers in the following description.
In the figure, (a) shows inter-column combined data,
(B) shows the contents of the search path output file 18. The search path determination unit 12 receives the key column X and the target column Y from the column name input unit 11 and reads the search path by referring to the inter-column combined data (a). The read result is written in the search path output file 18 (b).

【0029】 まず、出力ファイル18(b)に目的
カラム名Yを記述する。 次に、カラム間結合データ(a)の(X,Y)欄α
にアクセスし、結合次数n、直前カラムCn 、直前テー
ブルTn+1 をバッファに読み込む。 そして、直前カラム、直前テーブルをβに示す形式
で出力ファイル18(b)に記述する。
First, the target column name Y is described in the output file 18 (b). Next, the (X, Y) column α of the inter-column join data (a)
To access the coupling order n, the immediately preceding column Cn, and the immediately preceding table Tn + 1 into the buffer. Then, the immediately preceding column and the immediately preceding table are described in the output file 18 (b) in the format shown by β.

【0030】 次に、結合次数が0でなければに移
行する。 (X,Cn )欄にアクセスし、同様の手順を行う。 これを結合次数が0の欄(カラム間結合データの(X,
C1)欄)に突き当たるまで繰り返す。結果として出力
ファイル18には、目的カラムYから入力カラムXに至
る中継テーブル・カラム列が所定の書式で出力される。
Next, if the bond order is not 0, the process proceeds. Access the (X, Cn) column and perform the same procedure. This is a column where the bond order is 0 ((X,
Repeat until you hit column C1). As a result, the output file 18 outputs a relay table / column sequence from the target column Y to the input column X in a predetermined format.

【0031】[0031]

【実施例】以下に本発明の実施例を図面と共に説明す
る。図9は、本発明の実施例のデータベース内のテーブ
ルを示す。同図に示すデータベース内のテーブルは、
「社員テーブル」、「役職テーブル」、「所属組織テー
ブル」、「ロケーションテーブル」、「県特産物テーブ
ル」の5つのテーブルが存在する。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 9 shows the tables in the database of the embodiment of the present invention. The table in the database shown in the figure is
There are five tables: "employee table", "post table", "affiliation table", "location table", and "prefecture special product table".

【0032】図10は、図9に示すテーブルに対応する
カラム管理表の例を示す。同図に示す「社員テーブル」
のカラムには、「名前」、「年齢」、「役職」、「所
属」が含まれ、「所属組織テーブル」には、「所属」、
「業務内容」、「ロケーション」が含まれ、「役職テー
ブル」には、「役職」と「給与」が含まれ、「ロケーシ
ョンテーブル」には、「ロケーション」と「県」が含ま
れ、「県特産品テーブル」には、「県」と「特産物」が
含まれる。
FIG. 10 shows an example of a column management table corresponding to the table shown in FIG. "Employee table" shown in the figure
Column contains "name", "age", "post", "affiliation", "affiliation table", "affiliation",
"Job description" and "Location" are included, "Title table" includes "Title" and "Salary", "Location table" includes "Location" and "Prefecture", and "Prefecture" The “special product table” includes “prefecture” and “special product”.

【0033】図11は、図10のカラム管理表に対応し
たカラム間結合データの例を示す。図11において、
「所属組織」は、「所属組」、「特産物」は「特産」、
「ロケーション」は「ロケ」と略記するものとする。図
12は、キーカラムを「名前」、目的カラムを「特産
物」とした場合の検索結果の出力例を示す。
FIG. 11 shows an example of inter-column combined data corresponding to the column management table of FIG. In FIG.
"Affiliation" is "affiliation", "special product" is "special product",
“Location” shall be abbreviated as “location”. FIG. 12 shows an output example of search results when the key column is “name” and the target column is “special product”.

【0034】[1]まず、カラム管理表入力部17から
図10のカラム管理表が入力される。カラム管理表16
の第1行は、「名前」カラムの存在するテーブルを示し
ている。「名前」カラムは「社員テーブル」のみに存在
するため、「社員テーブル」の列にのみ○印が付いてい
る。他の行についても同様で、その行のカラムの存在す
るテーブルの列には○印が付与される。
[1] First, the column management table input unit 17 inputs the column management table of FIG. Column management table 16
The first row of indicates the table in which the "name" column exists. Since the “name” column exists only in the “employee table”, only the column “employee table” is marked with a circle. The same applies to other rows, and the column of the table in which the column of that row exists is marked with a circle.

【0035】[2] 次に、カラム間結合判定部15で
カラム間の結合関係を判定する。以下に、「名前」と他
のカラムの結合関係を判定し、結合データとして図11
に示すデータを作成するまでの処理手順を図6に従って
説明する。 (1) まず、「名前」と0次結合関係にあるカラムが
判定され、「名前」の行と当該カラムの列の交差する欄
に「0(「名前」とそのカラムをつなぐテーブル名)」
の形で記録が行われる(ステップ102)。
[2] Next, the inter-column connection determination unit 15 determines the connection relationship between columns. Below, the connection relationship between the “name” and other columns is determined, and the connection data shown in FIG.
The processing procedure until the data shown in FIG. (1) First, a column having a zero-order connection relationship with "name" is determined, and "0 (" name "and the table name that connects that column)" is displayed in the column where the row of "name" and the column of the column intersect.
Is recorded (step 102).

【0036】なお、0次結合関係にあるとは、同じテー
ブルにあるということである。例えば、図11において
「名前」と「年齢」「役職」「所属組織」は同じ「社
員」テーブルにあるため、それぞれの交差欄に「0−
(社員)」という記号が書き込まれている。
It should be noted that having a 0th order connection relationship means that they are in the same table. For example, in FIG. 11, since “name”, “age”, “post”, and “belonging organization” are in the same “employee” table, “0-
The symbol "(employee)" is written.

【0037】(2) 次に、表の最初の行のカラムがX
とされる。ここでは、「名前」がXとなる(ステップ1
03)。 (3) X、即ち、「名前」と1次結合関係にあるカラ
ムの判定が行われる(ステップ104、105)。判定
は、図7の手順に従うものとする。即ち、 「名前」と0次関係にあるカラムの1つに着目す
る。ここでは、「所属組織」を取り上げる。
(2) Next, the column in the first row of the table is X
It is said. Here, the "name" is X (step 1
03). (3) X, that is, a column having a primary binding relationship with "name" is determined (steps 104 and 105). Judgment shall follow the procedure of FIG. That is, attention is paid to one of the columns having a zero-order relationship with the “name”. Here, "affiliation" is taken up.

【0038】 「所属組織」という文字列を変数Cに
入れ、「所属組織」の行にアクセスする。 「所属組織」の行で「所属組織」と0次結合関係に
あるカラムに着目する。「名前」「年齢」「役職」「業
務内容」「ロケーション」が該当する。
The character string “belonging organization” is put in the variable C, and the row of “belonging organization” is accessed. Attention is paid to the column having a zero-order connection relationship with "affiliation" in the row of "affiliation". “Name”, “age”, “post”, “business content”, and “location” are applicable.

【0039】 「名前」「年齢」「役職」「業務内
容」「ロケーション」の各カラム列と「名前」の行の交
差欄を調べ、接続関係が判定されているかをチェックす
る。ここでは、「業務内容」「ロケーション」の部分が
未判定である。 (C(即ち、「所属組織」)、「業務内容」)及び
(C,「ロケーション」)の欄にアクセスし、「−()
−」内に記述された直前テーブル名を配列Tに読み取
る。図11の例では、「業務内容」に対応する配列要素
T(1)、「ロケーション」に対応する配列要素T
(2)には、いずれも「所属組織」が入る。
The intersections of the “Name”, “Age”, “Title”, “Job Description”, “Location” column columns and the “Name” row are checked to see if a connection relationship has been determined. Here, the "business content" and "location" portions are undetermined. Access the columns of (C (that is, "belonging organization"), "business content") and (C, "location"), and
The immediately preceding table name described in "-" is read into the array T. In the example of FIG. 11, the array element T (1) corresponding to “business content” and the array element T corresponding to “location”
In "(2)", the "affiliation" is entered.

【0040】 (「名前」、「業務内容」)、(「名
前」,「ロケーション」)欄にそれぞれ結合関係を記載
する。結合次数1,Tのそれぞれの要素に対応する内
容、変数Cの内容を記述する。結果としてそれぞれの欄
には、 「1−(所属組織)−所属組織」 「1−(所属組織)−所属組織」 と記述されることになる。
The connection relations are described in the (“name”, “business content”) and (“name”, “location”) columns, respectively. The contents corresponding to the respective elements of the coupling order 1 and T and the contents of the variable C are described. As a result, in each column, "1- (belonging organization) -belonging organization" and "1- (belonging organization) -belonging organization" will be described.

【0041】 「名前」と0次関係にある他のカラム
「年齢」「役職」についても同様のことを行う。 (4) 図6のステップ106、107において、終了
条件として、ここでは、「名前」と1次結合関係にある
カラムが存在し、しかも「名前」の行に余白が存在する
ので、終了条件には該当しない。そこで、kを1つ増や
して1にして、ステップ105に移行する。
The same applies to the other columns “age” and “post” that have a zero-order relationship with “name”. (4) In steps 106 and 107 of FIG. 6, as the end condition, there is a column that has a primary binding relationship with “name”, and there is a blank space in the line of “name”. Is not applicable. Therefore, k is incremented by 1 to 1 and the process proceeds to step 105.

【0042】(5) 以上の手順を繰り返すと「特産
物」と「名前」との3次結合関係が判定された時点で、
ステップ107の終了条件が満たされ、「名前」と他の
カラムとの結合関係は判定し尽くされたことになる。 [3] カラム名入力部11からキーカラム名「名
前」、目的カラム名「特産物」が入力されたとする。検
索経路判定部12は、図8に従って検索経路を判定し、
結果を図12に示すような出力ファイル18に記述す
る。
(5) When the above procedure is repeated, at the time when the tertiary bond relationship between the "special product" and the "name" is determined,
This means that the ending condition of step 107 is satisfied, and the binding relationship between “name” and other columns is exhausted. [3] It is assumed that the key column name “name” and the target column name “special product” are input from the column name input unit 11. The search route determination unit 12 determines the search route according to FIG.
The result is described in the output file 18 as shown in FIG.

【0043】(1) まず、検索経路出力部13が出力
ファイル18に目的カラム名「特産物」と書き込む。 (2) (「名前」、「特産物」)欄にアクセスする。 (3) 直前テーブル名「県特産物」,直前カラム名
「県」を読み取り、検索経路出力部13が当該内容を出
力ファイル18に書き込む。
(1) First, the search path output unit 13 writes the target column name “special product” in the output file 18. (2) Access the ("Name", "Special product") column. (3) The immediately preceding table name “prefecture special product” and the immediately preceding column name “prefecture” are read, and the search path output unit 13 writes the contents in the output file 18.

【0044】(4) 結合次数が0ではないので、次に
進む。 (5) (「名前」,「特産物」の直前のカラム(即ち
「県」))の欄にアクセスする。 (6) 上記の(1)〜(4)と同様の処理を行う。こ
れを結合次数が0のカラムの欄、即ち、(「名前」,
「所属組織」)の欄に突き当たるまで繰り返す。結果と
して、検索経路が検索経路出力部13により図12に示
すような形式で記述される。
(4) Since the bond order is not 0, the process proceeds to the next step. (5) Access the column of (column just before “name” and “special product” (ie “prefecture”)). (6) The same processes as (1) to (4) above are performed. This is the column of the column where the bond order is 0, that is, ("name",
Repeat until you hit the "Affiliation" column. As a result, the search route is described by the search route output unit 13 in the format shown in FIG.

【0045】即ち、目的カラムへの検索経路は、 特産物 ↓ (県特産物) ↓ 県 ↓ (所属組織) ↓ 所属組織 ↓ (社員) ↓ 名前 となる。That is, the search route to the target column is: special product ↓ (prefecture special product) ↓ prefecture ↓ (affiliation organization) ↓ affiliation organization ↓ (employee) ↓ name.

【0046】以上の処理により出力ファイル18に蓄積
されたデータを用いてキーカラムから目的カラムへの検
索経路を出力することができる。なお、本発明は、上記
の実施例に限定されることなく、特許請求の範囲内で種
々変更・応用が可能である。
With the above processing, the search path from the key column to the target column can be output using the data accumulated in the output file 18. It should be noted that the present invention is not limited to the above-described embodiment, but can be variously modified and applied within the scope of the claims.

【0047】[0047]

【発明の効果】上述のように本発明の検索経路出力方法
及び装置によれば、以下のような効果を奏する。 (1) 検索経路そのものを知識として装置に与えてお
く必要はなく、各カラムがどのテーブルに存在するのか
のデータを与えておけばよい。
As described above, the search path output method and apparatus of the present invention have the following effects. (1) It is not necessary to give the search route itself as knowledge to the apparatus, and it suffices to give data indicating in which table each column exists.

【0048】(2) そのため、人間が検索経路を調べ
る労を省くことができる。
(2) Therefore, it is possible to save the labor of the human being searching the search route.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の原理を説明するための図である。FIG. 1 is a diagram for explaining the principle of the present invention.

【図2】本発明の原理構成図である。FIG. 2 is a principle configuration diagram of the present invention.

【図3】本発明の検索経路出力装置の構成図である。FIG. 3 is a configuration diagram of a search route output device of the present invention.

【図4】本発明のカラム管理表の構成図である。FIG. 4 is a configuration diagram of a column management table of the present invention.

【図5】本発明のカラム間結合データの構成を示す図で
ある。
FIG. 5 is a diagram showing a structure of inter-column combined data of the present invention.

【図6】本発明のカラム間結合判定部の動作を示すフロ
ーチャートである。
FIG. 6 is a flowchart showing the operation of the inter-column coupling determination unit of the present invention.

【図7】本発明のカラム間結合判定部の結合関係判定処
理を説明するための図である。
FIG. 7 is a diagram for explaining the connection relation determination processing of the inter-column connection determination unit of the present invention.

【図8】本発明のカラム間結合データから検索経路を読
み取る手順を示す図である。
FIG. 8 is a diagram showing a procedure for reading a search path from inter-column combined data according to the present invention.

【図9】本発明の一実施例のデータベース内のテーブル
を示す図である。
FIG. 9 is a diagram showing a table in a database according to an embodiment of the present invention.

【図10】本発明の一実施例の図9に示すテーブルに対
応するカラム管理表の例を示す図である。
FIG. 10 is a diagram showing an example of a column management table corresponding to the table shown in FIG. 9 according to an embodiment of the present invention.

【図11】本発明の一実施例の図10のカラム管理表に
対応したカラム間結合データの例を示す図である。
11 is a diagram showing an example of inter-column combined data corresponding to the column management table of FIG. 10 according to an embodiment of the present invention.

【図12】本発明の一実施例の検索結果の出力例を示す
図である。
FIG. 12 is a diagram showing an output example of search results according to an embodiment of the present invention.

【符号の説明】[Explanation of symbols]

9 カラム管理表 10 経路判定部 11 カラム名入力部 12 検索経路判定部 13 検索経路出力部 14 カラム間結合データ 15 カラム間結合判定部 16 カラム管理表 17 カラム管理表入力部 18 出力ファイル 9 Column management table 10 Route determination unit 11 Column name input unit 12 Search route determination unit 13 Search route output unit 14 Inter-column join data 15 Inter-column join determination unit 16 Column management table 17 Column management table input unit 18 Output file

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 テーブル上に登録された各種の情報であ
るカラムが複数のテーブルに分散して存在するデータベ
ースシステムにおいて、該カラムが該データベース中の
どこに格納されているかを検索するための検索経路を見
つける検索経路出力方法において、 前記データベースを検索するためのキーとなるキーカラ
ム名と検索対象のカラム名を入力し、 各カラムの格納情報を示すカラム管理表を参照して、カ
ラム間の結合状態を判定し、 判定結果に基づいてキーカラムから検索対象のカラム名
への検索経路を判定することを特徴とする検索経路出力
方法。
1. In a database system in which columns, which are various kinds of information registered on a table, are distributed over a plurality of tables, a search path for searching where in the database the columns are stored. In the search path output method to find the, enter the key column name that is the key to search the database and the column name of the search target, and refer to the column management table that shows the storage information of each column And a search route output method that determines the search route from the key column to the column name of the search target based on the determination result.
【請求項2】 前記カラム間の結合情報を判定する際
に、 あるカラムXとカラムYがn次結合関係(同一テーブ
ル)に存在し、該カラムYとカラムZが0次結合関係に
存在する関係にあれば、カラムXとカラムZは、0から
n+1次の何れかの次数で結合しているという論理を用
いて、低い次数の結合判定結果に基づいて高い次数の結
合関係を判定する請求項1記載の検索経路出力方法。
2. A column X and a column Y exist in an nth-order connection relationship (same table) and a column Y and a column Z exist in a 0th order connection relationship when determining connection information between the columns. If there is a relationship, column X and column Z are connected to each other at any degree from 0 to n + 1, and a high-order connection relationship is determined based on a low-order connection determination result. The search route output method according to item 1.
【請求項3】 テーブル上に登録された各種の情報であ
るカラムが複数のテーブルに分かれて存在するデータベ
ースシステムにおいて、該データベースより該カラムを
検索する場合の検索経路を判定するための検索経路出力
装置において、 前記データベースを検索するためのキーとなるカラム
(以下、キーカラム)名、検索の目的となるカラム(以
下、目的カラム)名を入力するカラム名入力手段と、 各カラムがどのテーブルに存在するかを管理するカラム
管理表と、 前記キーカラムから前記目的カラムへの検索経路を判定
する検索経路判定手段と、 前記検索経路判定手段の判定結果を出力する判定結果出
力手段とを具備し、 前記検索経路判定手段は、 前記カラム管理表を入力するカラム管理表入力手段と、 前記カラム管理表を参照して、各カラムが他のカラムと
どのテーブルを介して結合しているかのカラム間の結合
状態を判定し、所定のデータ形式に変換して格納するカ
ラム間結合判定手段と、 前記カラム間結合判定手段の結果に基づいてキーカラム
から目的カラムへの検索経路を判定する検索経路判定手
段よりなることを特徴とする検索経路出力装置。
3. A search path output for determining a search path when searching for the column from the database in a database system in which columns of various types of information registered on the table are present in a plurality of tables. In the device, a column name input means for inputting a column (hereinafter, key column) name that is a key for searching the database, a column name (hereinafter, target column) that is a search target, and which table each column exists in A column management table for managing whether to perform a search route determination unit that determines a search route from the key column to the target column, and a determination result output unit that outputs a determination result of the search route determination unit, The search route determination means refers to the column management table input means for inputting the column management table and the column management table. The inter-column join determination means for determining the join state between the columns in which each column is joined to the other column, converting the data to a predetermined data format, and storing the inter-column join determination means, A search route output device comprising search route determining means for determining a search route from a key column to a target column based on a result.
【請求項4】 前記カラム間結合判定手段は、 あるカラムXとカラムYがn次結合関係(同一テーブ
ル)に存在し、該カラムYとカラムZが0次結合関係に
存在する関係にあれば、カラムXとカラムZは、0から
n+1次の何れかの次数で結合しているという論理を用
いて、低い次数の結合判定結果に基づいて高い次数の結
合関係を判定する手段を含む請求項3記載の検索経路出
力装置。
4. The inter-column coupling determining means determines that a certain column X and a column Y are in an nth-order coupling relationship (same table), and the columns Y and Z are in a zero-order coupling relationship. , Column X and column Z include means for determining a high-order connection relation based on a low-order connection determination result by using the logic that they are connected at any order from 0 to n + 1. 3. The search route output device described in 3.
JP7185580A 1995-07-21 1995-07-21 Retrieval path output method and device Pending JPH0934899A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7185580A JPH0934899A (en) 1995-07-21 1995-07-21 Retrieval path output method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7185580A JPH0934899A (en) 1995-07-21 1995-07-21 Retrieval path output method and device

Publications (1)

Publication Number Publication Date
JPH0934899A true JPH0934899A (en) 1997-02-07

Family

ID=16173302

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7185580A Pending JPH0934899A (en) 1995-07-21 1995-07-21 Retrieval path output method and device

Country Status (1)

Country Link
JP (1) JPH0934899A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11161665A (en) * 1997-11-28 1999-06-18 Fujitsu Ltd Data base processor and recording medium
JP2019125283A (en) * 2018-01-19 2019-07-25 株式会社日立製作所 Query generation support method and query generation support device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11161665A (en) * 1997-11-28 1999-06-18 Fujitsu Ltd Data base processor and recording medium
JP2019125283A (en) * 2018-01-19 2019-07-25 株式会社日立製作所 Query generation support method and query generation support device

Similar Documents

Publication Publication Date Title
CA2198735C (en) Parallel processing system for traversing a data base
JP2006172446A (en) Complex data access
JPH04237374A (en) Data base-system and retrieving method
JP3515810B2 (en) Sort processing method and apparatus
JPH0934899A (en) Retrieval path output method and device
WO2005043409A1 (en) Table-formatted data connection method, connection device, and program
US6973454B2 (en) Data processing method, computer readable recording medium, and data processing device
JP3183252B2 (en) Database search system
US6643632B1 (en) Data processing system and computer-readable recording medium recorded with a program for causing a computer to process data
JPH07296009A (en) Data base integration/retrieval device
JPH0962700A (en) Method and device for constructing dictionary
JPS6175432A (en) Information file device
JP2008009966A (en) Device and method for setting business process
JPS62229475A (en) Picture file system
JP3109330B2 (en) Form output device
JP3109331B2 (en) Form output device
JP2002297897A (en) Method and program for storing data
JPH10326283A (en) Document retrieval system
JP3824091B2 (en) Relational database system
JP2788849B2 (en) Grouping method by serial number description
JPH01248233A (en) Data base retrieving device
JPS63298630A (en) System for supplying source code
JPS60225938A (en) Information retrieving system
JPH10198551A (en) Merge processor
JPS58115543A (en) Sorting method