JP2001273178A - Method and system for controlling database - Google Patents

Method and system for controlling database

Info

Publication number
JP2001273178A
JP2001273178A JP2000088694A JP2000088694A JP2001273178A JP 2001273178 A JP2001273178 A JP 2001273178A JP 2000088694 A JP2000088694 A JP 2000088694A JP 2000088694 A JP2000088694 A JP 2000088694A JP 2001273178 A JP2001273178 A JP 2001273178A
Authority
JP
Japan
Prior art keywords
record
database
order
data
network
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
JP2000088694A
Other languages
Japanese (ja)
Inventor
Kazuhiro Okamoto
一弘 岡本
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.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2000088694A priority Critical patent/JP2001273178A/en
Publication of JP2001273178A publication Critical patent/JP2001273178A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a system capable of adding processing of a record corresponding to the meaning of the linking order of the record in a network-type database when providing an operation interface using an SQL language in a network-type database system. SOLUTION: Information on the storing order of record data is provided in definition information on coordinating of a table to be dealt with by an SQL language and record data in the network-type database. When performing adding processing of the record, the adding position of the record is decided in accordance with information concerning this storing order.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、データベース制御
装置およびシステムに関わり、特に、ネットワーク型デ
ータベースをSQL言語インタフェースで参照および更新
可能にするデータベース制御装置およびシステムに関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a database control device and system, and more particularly, to a database control device and system that allows a network type database to be referenced and updated by an SQL language interface.

【0002】[0002]

【従来の技術】従来から、ネットワーク型データベース
は広く用いられていたが、レコード単位でデータを操作
するため、データベースの参照及び更新はレコード単位
の操作に基づいて手続き的に記述する必要があり、利用
しにくい面がある。一方、リレーショナルデータベース
はテーブル単位でのデータ操作を基本とし、比較的利用
し易いインタフェースを提供できる。また、リレーショ
ナルデータベースの標準的な検索言語であるSQLはリレ
ーショナルデータベースに限らず、テーブル形式のデー
タを操作するためのインタフェースとして幅広く利用さ
れるようになってきている。そこで、ネットワーク型デ
ータベースの参照及び更新をSQL言語インタフェースで
行えるようにする方式が考えられている。例えば、特開
平06−282576号公報に記載されているネットワ
ーク型データベースのリレーショナルアクセス方式で
は、ネットワーク型データベースのレコードデータをテ
ーブルに対応付ける定義情報を与え、その対応付けられ
たテーブルに対してSQLを用いた操作を行えるようにし
ている。
2. Description of the Related Art Conventionally, network-type databases have been widely used. However, since data is operated on a record basis, reference and update of the database must be described procedurally based on operation on a record basis. Some aspects are difficult to use. On the other hand, a relational database is based on data manipulation on a table basis and can provide a relatively easy-to-use interface. In addition, SQL, which is a standard search language for relational databases, is not limited to relational databases, but has come to be widely used as an interface for operating table format data. Accordingly, a method has been considered in which a network type database can be referenced and updated using an SQL language interface. For example, in a relational access method for a network-type database described in Japanese Patent Application Laid-Open No. 06-282576, definition information for associating record data of a network-type database with a table is provided, and SQL is used for the table associated with the table. Operations that can be performed.

【0003】[0003]

【発明が解決しようとする課題】ネットワーク型データ
ベースでは複数のレコードをポインタでリンクするデー
タ構造をとっている。そこで、レコード中のフィールド
値だけでなく、レコードのリンク順序に意味を持たせて
いる場合がある。例えば、レコードのリンク順序が受付
順になっている応募者情報レコードを持つネットワーク
型データベースでは、このリンク順序を変えてしまうと
同じ内容のレコードの集合からなるデータベースでも参
照及び更新の手順が違うものになってしまう。例えば、
「受付の最初10件の応募者に関するデータを出力す
る」という処理を考えると、リンク順序が受付順であれ
ばリンクに従って10個のレコードを順次読めばよい
が、順序を変えてしまうとこの対応が分からなくなって
しまう。もし、エントリ番号をレコード内のフィールド
データとして持っているならば、エントリ番号を条件と
する条件検索を行えばレコードの出力は可能である。し
かし、全応募者情報レコードに対して検索を行うことに
なり、効率が大幅に悪くなる。したがって、このような
データベースにレコードを追加する場合、レコードのリ
ンク順序の持つ意味に沿った位置に追加できる必要があ
る。しかし、上記の従来技術ではSQL言語がテーブルの
行の順序を規定していないことから、INSERT文でテーブ
ルに行を追加した場合の対応するデータベース中の追加
レコードの位置を規定することができない。本発明の目
的は、ネットワーク型データベースシステムにSQL言語
を用いた操作インタフェースを提供する際に、ネットワ
ーク型データベースでのレコードのリンク順序が持つ意
味に対応したレコードの追加処理が可能なデータベース
制御装置およびシステムを提供することにある。
The network type database has a data structure in which a plurality of records are linked by pointers. Therefore, not only the field values in the record but also the link order of the record may have meaning. For example, in a network-type database that has applicant information records in which the link order of records is the order of reception, if this link order is changed, a database consisting of a set of records with the same contents will have different reference and update procedures. turn into. For example,
Considering the process of "outputting data on the first ten applicants of reception", if the link order is the reception order, it is sufficient to sequentially read ten records according to the link, but if the order is changed, this response Is lost. If the entry number is stored as field data in the record, the record can be output by performing a conditional search using the entry number as a condition. However, a search is performed for all applicant information records, and the efficiency is greatly reduced. Therefore, when a record is added to such a database, it must be able to be added at a position along the meaning of the link order of the record. However, in the above conventional technology, since the SQL language does not specify the order of the rows of the table, it is not possible to specify the position of the additional record in the database when a row is added to the table by the INSERT statement. An object of the present invention is to provide a network type database system with an operation interface using an SQL language, a database control device capable of adding records corresponding to the meaning of the link order of records in a network type database, and It is to provide a system.

【0004】[0004]

【課題を解決するための手段】上記目的を達成するため
に、本発明は、ネットワーク型データベースをSQL言語
インタフェースで参照および更新することが可能なデー
タベースシステムにおいて、SQL言語で取り扱うテーブ
ルとネットワーク型データベースのレコードデータの対
応付けに関する定義情報の中にレコードデータの格納順
序に関する情報を持たせる。そして、レコードの追加処
理を行う際に、この格納順序に関する情報に従ってレコ
ードの追加位置を決定する。ここで、格納順序に関する
情報は、順序指定のためのフィールド名とフィールド値
の昇順または降順で示した順序の種別からなる情報とし
て与える。以上のような構成でネットワーク型データベ
ースのSQL言語を用いた操作インタフェースによる追加
位置の指定が可能なレコードの追加を実現する。
SUMMARY OF THE INVENTION In order to achieve the above object, the present invention provides a database system capable of referencing and updating a network-type database with an SQL language interface. The information on the storage order of the record data is provided in the definition information on the association of the record data. Then, when performing the record addition processing, the record addition position is determined according to the information on the storage order. Here, the information on the storage order is given as information including a field name for specifying the order and a type of the order shown in ascending or descending order of the field value. With the above configuration, the addition of a record whose addition position can be specified by the operation interface using the SQL language of the network type database is realized.

【0005】[0005]

【発明の実施の形態】以下、図面を用いて本発明の実施
形態について説明する。図1は、本発明のデータベース
システムの実施形態を示すのブロック図である。この実
施形態のデータベースシステムは、入出力装置1、操作
要求受付部2、操作要求変換部3、データベース4、テ
ーブル定義格納装置5から構成されている。また、デー
タベース4は、レコードデータ41及びデータベース定
義42を備え、テーブル定義格納装置5はレコード=行
対応定義51及びレコード格納順序定義52を備えてい
る。操作要求変換部3およびテーブル定義格納装置5で
データベース制御装置7を構成している。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of the database system of the present invention. The database system according to this embodiment includes an input / output device 1, an operation request receiving unit 2, an operation request conversion unit 3, a database 4, and a table definition storage device 5. The database 4 includes record data 41 and a database definition 42. The table definition storage device 5 includes a record = row correspondence definition 51 and a record storage order definition 52. The operation request converter 3 and the table definition storage device 5 constitute a database control device 7.

【0006】まず、データベース4の構成について説明
する。データベース4には図2のような親子の関連を持
つレコードによって構成されるネットワーク型データベ
ースが構築されているものとする。図2では、親レコー
ドとして、応募回次情報レコード、子レコードとして応
募者情報レコードを例示している。この例の場合のデー
タベース4内のレコードデータ41の内容例を図3に示
す。図3において、応募回次情報レコードは「回次、応
募開始日、応募終了日、応募総数」の4つのフィールド
を持ち、応募者情報レコードは「氏名、住所、電話番
号、エントリ日時」の4つのフィールドを持っている。
また、各応募者情報レコードはある回次の応募回次情報
レコードとの間で直接または他の子レコードを介して間
接的にリンク(ポインタによる関連付け)を持ってい
る。同じ回次に関する複数の応募者情報レコードはそれ
らと対応する応募回次情報レコードとの間にチェインを
形成するような形でリンクを持っている。親レコードに
はキーとなるフィールドがあり、親レコードへのアクセ
スは主にキーフィールドの値を指定することで行う。図
3の例では、応募回次情報レコードの「回次」フィール
ドがキーである。一方、子レコードへのアクセスは直接
または間接的にリンクを持った親レコードからリンクを
たどることで行う。例えば、図3の「氏名」が「石田x
x」である応募者情報レコードには「回次」が「第1
回」である応募回次情報レコードから、「氏名」が「山
川xx」である応募者情報レコードを経てたどり着くこと
ができる。上記のようなフィールドの構成やリンクの構
造を記述してあるのがデータベース定義42である。図
4は図2及び図3で示したデータベース4のデータベー
ス定義42を記述した例である。レコードの名前と親子
の種別、レコードに含まれるフィールドの名前、親レコ
ードのキーフィールド及び子レコードが対応付けられる
親レコード名が定義されている。
First, the configuration of the database 4 will be described. It is assumed that a network type database composed of records having a parent-child relationship as shown in FIG. FIG. 2 illustrates an application information record as a parent record and an applicant information record as a child record. FIG. 3 shows an example of the contents of the record data 41 in the database 4 in this case. In FIG. 3, the application round information record has four fields of “round, application start date, application end date, total number of applications”, and the applicant information record has four fields of “name, address, telephone number, entry date and time”. Has two fields.
In addition, each applicant information record has a link (pointer association) directly or indirectly through another child record with the application information record of a certain round. Multiple applicant information records for the same round have links in such a way as to form a chain between them and the corresponding round information record. The parent record has a key field, and access to the parent record is mainly performed by specifying the value of the key field. In the example of FIG. 3, the “pass” field of the application turn information record is a key. On the other hand, access to a child record is performed by directly or indirectly following a link from a parent record having a link. For example, the "name" in FIG.
“Appendix” is “No. 1” in the applicant information record
It is possible to arrive from the application round information record of “time” through the applicant information record of “name” of “Yamakawa xx”. The database definition 42 describes the field configuration and link structure as described above. FIG. 4 is an example in which the database definition 42 of the database 4 shown in FIGS. 2 and 3 is described. The record name and the type of parent and child, the name of a field included in the record, the key field of the parent record, and the parent record name associated with the child record are defined.

【0007】一方、テーブル定義格納装置5にはデータ
ベース4のネットワーク構造を持ったレコードデータを
仮想的なテーブルとして取扱うための対応付けに関する
情報が格納されている。レコード=行対応定義51はテ
ーブルを構成する行データのフィールドがレコードデー
タのどのフィールドと対応付けられるかを示している。
図5は、図2及び図3で示したデータベース4のレコー
ドを基にテーブルを構成する場合のレコード=行対応定
義51の例である。構成するテーブルのテーブル名51
1、テーブルを構成するレコードのレコードタイプ名
(選択レコードタイプ)512、テーブル中の行を構成
するフィールド名(行フィールド)513及び行フィー
ルドに対応するレコードデータのタイプ名(レコードタ
イプ)514とフィールド名(レコードフィールド)5
15が定義されている。
[0007] On the other hand, the table definition storage device 5 stores information relating to correspondence for treating record data having a network structure of the database 4 as a virtual table. The record = row correspondence definition 51 indicates which field of the record data corresponds to the field of the row data constituting the table.
FIG. 5 is an example of a record = row correspondence definition 51 when a table is configured based on the records of the database 4 shown in FIGS. 2 and 3. Table name 51 of the table to be configured
1. Record type name (selected record type) 512 of a record constituting a table, field name (row field) 513 constituting a row in a table, and record data type name (record type) 514 and field corresponding to the row field First name (record field) 5
15 are defined.

【0008】レコード格納順序定義52はテーブル中の
行に対応付けられるデータベース4中のレコードの格納
順序に関するルールを示している。図6は、図2及び図
3で示したデータベースのレコードを図5のレコード=
行対応定義51を用いてテーブル化した場合のレコード
格納順序定義52の例である。レコードの格納順序に関
するルールの種別(順序種別)521とその内容を決定
する項目(ここでは順序を決定するフィールド名と昇順
/降順の別)522が定義されている。順序を決定する
キーフィールドとして複数のフィールドとその昇順/降
順の別を「第1キー云々、第2キー云々、…」のように
指定してもよい。ここではレコード中のフィールドと昇
順/降順の別を指定することで格納順序を規定している
が、これ以外でも、追加するレコードデータから追加位
置を決定できる手順があればそれを新たな順序種別とし
て設定し、利用することが可能である。
[0008] The record storage order definition 52 indicates rules regarding the storage order of records in the database 4 corresponding to the rows in the table. FIG. 6 shows records of the database shown in FIG. 2 and FIG.
5 is an example of a record storage order definition 52 when tabulated using a row correspondence definition 51; A rule type (order type) 521 relating to the storage order of records and items for determining its contents (here, field names for determining the order and ascending / descending order) 522 are defined. As a key field for determining the order, a plurality of fields and their ascending / descending order may be designated as “first key, second key, etc.”. Here, the storage order is specified by specifying the field in the record and the ascending order / descending order. However, if there is a procedure that can determine the addition position from the record data to be added, it is added to the new order type. It is possible to set and use as.

【0009】続いてSQL言語インタフェースでのデー
タベース処理について述べる。この処理は、言わばネッ
トワーク型データベースのレコードデータをテーブル定
義の内容に従った仮想的なテーブルと見て問合せを行う
ものである。図7は、図3のレコードデータを持つデー
タベース4とそれを図5のレコード=行対応定義51に
従って見た場合の仮想的なテーブル71との対応を示し
ている。SQL文による問合せはこのような仮想的なテ
ーブル71に対するものとして処理される。まず、デー
タベース参照処理の流れを説明する。入出力装置1を通
じてテーブルデータ参照のためのSQL文が入力される
と、その文は操作要求受付部2に渡される。操作要求受
付部2は、操作要求変換部3に対するSQL文の処理要
求を発行する。操作要求変換部3は、SQL文のテーブ
ルデータ参照に関する要求をデータベース4に対するレ
コードデータ51へのアクセスコマンドに変換する。そ
の際、テーブル71中の行とデータベース4中のレコー
ドはテーブル定義格納装置5のレコード=行対応定義5
1に従って対応付けられる。コマンドを受けたデータベ
ース4は、コマンドに応じたレコードデータを操作要求
変換部3に返す。操作要求変換部3はレコード=行対応
定義51に従ってレコードデータをテーブルデータに展
開する。この時、テーブルデータはネットワーク型デー
タベースにおける1つのタイプの親レコードとそれに対
する1つのタイプの子レコードとの間で、親子関係のリ
ンクを持つレコードのフィールドの並びを結合した行の
集合として構成する。そして、操作要求変換部3は展開
したテーブルデータを操作要求受付部2を通じて入出力
装置1に出力する。以上が、データベース参照の処理で
ある。
Next, the database processing in the SQL language interface will be described. In this process, an inquiry is made by looking at the record data of the network type database as a virtual table according to the contents of the table definition. FIG. 7 shows the correspondence between the database 4 having the record data of FIG. 3 and the virtual table 71 when the database 4 is viewed in accordance with the record = row correspondence definition 51 of FIG. The query by the SQL sentence is processed as to such a virtual table 71. First, the flow of the database reference process will be described. When an SQL sentence for table data reference is input through the input / output device 1, the sentence is passed to the operation request receiving unit 2. The operation request receiving unit 2 issues an SQL statement processing request to the operation request converting unit 3. The operation request conversion unit 3 converts a request relating to table data reference of an SQL statement into an access command to the record data 51 for the database 4. At this time, the row in the table 71 and the record in the database 4 are the record of the table definition storage device 5 = the row
1 are associated. The database 4 receiving the command returns record data corresponding to the command to the operation request conversion unit 3. The operation request conversion unit 3 expands the record data into table data according to the record = row correspondence definition 51. At this time, the table data is configured as a set of rows in which a row of a record having a parent-child relationship link is connected between one type of parent record and one type of child record in the network type database. . Then, the operation request conversion unit 3 outputs the developed table data to the input / output device 1 through the operation request reception unit 2. The above is the process of referring to the database.

【0010】次に、データベース更新処理の流れを説明
する。入出力装置1を通じてテーブルデータ更新のため
のSQL文が入力されると、その文は(テーブルデータ
参照の場合と同様に)操作要求受付部2で受付けられ、
操作要求変換部3に対するSQL文の処理要求となる。
操作要求変換部3は、SQL文のテーブルデータ更新に
関する要求をデータベース4に対するレコードデータ4
1のアクセスコマンドに変換する。ここでもテーブル中
の行とデータベース中のレコードはレコード=行対応定
義51に従って対応付けられるが、更新内容が子レコー
ドの追加を必要とする場合はレコード格納順序定義52
に従ってレコードの追加位置が決定される。コマンドを
受けたデータベース4は、コマンドに応じたレコードデ
ータの更新を実行し、その結果を操作要求変換部3に報
告する。そして、操作要求変換部3は更新処理の完了を
操作要求受付部2を通じて入出力装置1に報告する。以
上が、データベース更新の処理である。操作要求変換部
3でテーブルデータ更新のためのSQL文をデータベー
ス4に対するアクセスコマンドへ変換する際の、レコー
ド格納順序定義52に従ったレコードの追加位置決定が
本発明の特徴である。
Next, the flow of the database update process will be described. When an SQL statement for updating table data is input through the input / output device 1, the sentence is received by the operation request receiving unit 2 (similar to the case of referring to table data),
This is an SQL statement processing request to the operation request conversion unit 3.
The operation request conversion unit 3 sends a request for updating the table data of the SQL statement to the record data 4
1 access command. Again, the rows in the table are associated with the records in the database according to the record = row correspondence definition 51. However, if the updated content requires the addition of a child record, the record storage order definition 52
, The record addition position is determined. The database 4 receiving the command updates the record data according to the command, and reports the result to the operation request conversion unit 3. Then, the operation request conversion unit 3 reports the completion of the update process to the input / output device 1 through the operation request reception unit 2. The above is the database update process. A feature of the present invention is that, when the operation request conversion unit 3 converts an SQL statement for updating table data into an access command for the database 4, a record addition position is determined according to the record storage order definition 52.

【0011】続いて、子レコードの追加を伴う更新に関
する処理の詳細について説明する。図8は、SQLによ
る問合せのINSERT文でデータベース4にレコード
を追加する処理のフロー図である。まず、入力されたI
NSERT文のフィールド値の並びを、追加するレコー
ドデータに対応付ける(ステップ801)。SQLのI
NSERT文は「INSERT INTO<テーブル名>VALUES(<
フィールド値の並び>)」の形式であり、この中のフィ
ールド値の並びが追加するレコードデータのフィールド
値と対応付けられる。親レコードの追加の場合はレコー
ド=行対応定義51中でレコードタイプが親レコードと
対応している行フィールドを、子レコードの追加の場合
は同じくレコード=行対応定義51中でレコードタイプ
が子レコードと対応している行フィールドを対応付け
る。次に、親レコードの追加が必要かどうかを判定する
(ステップ802)。判定の条件は「親レコードに既に
同じ値をキーフィールドに持つレコードがあるかどう
か」という点である。もし、親レコードの追加が必要な
場合は(ステップ802でY)ステップ801の対応付
けで作成した親レコード追加のためのレコードデータを
データベースに追加する(ステップ803)。親レコー
ドの追加はリンクのチェインに拘束されないため、追加
位置を指定する必要はない。一方、親レコードの追加が
不要な場合は(ステップ802でN)この処理をスキッ
プする。続いて、子レコードの追加が必要かどうかを判
定する(ステップ804)。判定の条件は「テーブルに
子レコードに対応するフィールドがあるかどうか」とい
う点である。もし、子レコードの追加が必要な場合は
(ステップ804でY)レコード格納順序定義52の指
定に従って追加位置を決定し(ステップ805)、ステ
ップ801の対応付けで作成した子レコード追加のため
のレコードデータをデータベースに追加して(ステップ
806)処理を終了する。一方、子レコードの追加が不
要な場合は(ステップ804でN)そのまま処理を終了
する。以上がレコードの追加処理である。
Next, the details of the processing related to the update accompanied by the addition of the child record will be described. FIG. 8 is a flowchart of a process for adding a record to the database 4 using an INSERT statement of a query by SQL. First, the input I
The arrangement of the field values of the NSERT statement is associated with the record data to be added (step 801). SQL I
The NSERT statement is “INSERT INTO <table name> VALUES (<
Field value list>) ", and the field value list therein is associated with the field value of the record data to be added. In the case of adding a parent record, the row field whose record type corresponds to the parent record in the record = row correspondence definition 51, and in the case of adding a child record, the record type is also the record type in the record = row correspondence definition 51. Corresponds to the line field corresponding to. Next, it is determined whether or not a parent record needs to be added (step 802). The condition for the determination is that "is there a record in the parent record that already has the same value in the key field?" If the parent record needs to be added (Y in step 802), the record data for adding the parent record created by the association in step 801 is added to the database (step 803). Since the addition of the parent record is not tied to the link chain, there is no need to specify the addition position. On the other hand, if it is not necessary to add a parent record (N in step 802), this process is skipped. Subsequently, it is determined whether or not a child record needs to be added (step 804). The condition for the determination is that “whether the table has a field corresponding to the child record”. If a child record needs to be added (Y in step 804), the position to be added is determined according to the specification of the record storage order definition 52 (step 805), and the record for adding the child record created by the association in step 801 is created. The data is added to the database (step 806), and the process ends. On the other hand, if it is not necessary to add a child record (N in step 804), the process ends. The above is the record adding process.

【0012】図9は、図8で説明したレコードの追加処
理のうち、子レコードの追加位置を決定する処理の詳細
フロー図である。まず、親レコードのチェインから先頭
の子レコードを検索する(ステップ901)。親レコー
ドはそのキーフィールド(例えば、図7のデータベース
内容では「回次」)で検索でき、そこからのリンクで子
レコードが検索できる。この時、既にチェインの終わり
で次の子レコードが検索できなかった場合(ステップ9
02でY)、そのチェインの末尾にレコードデータの追
加位置を決定し(ステップ903)、処理を終了する。
一方、次の子レコードが検索できた場合(ステップ90
2でN)、そのままステップ904に進む。次に、追加
するレコードデータと検索した子レコードをレコード格
納順序定義52に示された「フィールド」及び「昇順/
降順」に従って比較し、検索した子レコードが追加する
レコードデータよりも後ろの順序かを判定する(ステッ
プ904)。「昇順」が指定されている場合、追加する
レコードデータの指定された「フィールド」の値が検索
した子レコードよりも小さければ検索した子レコードが
後ろの順序である。「降順」が指定されている場合、追
加するレコードデータの指定された「フィールド」の値
が検索した子レコードよりも大きければ検索した子レコ
ードが後ろの順序である。ここで、レコード格納順序定
義52で複数の順序キーが指定されている場合はあるキ
ー(第nキー)での比較でフィールドの値が等しい場合
にその次のキー(第n+1キー)での比較を行う。検索
した子レコードが追加するレコードデータよりも後ろの
順序の場合(ステップ904でY)、その子レコードの
前にレコードデータの追加位置を決定し(ステップ90
5)、処理を終了する。一方、検索した子レコードが追
加するレコードデータよりも後ろの順序でない場合(ス
テップ904でN)、チェインの次の子レコードを検索
し(ステップ906)、チェインの終わりの判定(ステ
ップ902)へ戻る。以上が子レコードの追加位置を決
定する処理である。
FIG. 9 is a detailed flow chart of the processing for determining the addition position of the child record in the record addition processing described in FIG. First, the first child record is searched from the chain of the parent record (step 901). The parent record can be searched by its key field (for example, “recurring” in the database contents of FIG. 7), and a child record can be searched by a link from that. At this time, if the next child record cannot be retrieved at the end of the chain (step 9).
02, Y), the record data addition position is determined at the end of the chain (step 903), and the process ends.
On the other hand, if the next child record can be retrieved (step 90)
(N in 2), and proceed to step 904 as it is. Next, the record data to be added and the retrieved child records are stored in the “field” and “ascending /
In accordance with "descending order", it is determined whether or not the retrieved child record is in an order after the record data to be added (step 904). When “ascending order” is specified, if the value of the specified “field” of the record data to be added is smaller than the searched child record, the searched child record is in the last order. When “descending order” is specified, if the value of the specified “field” of the record data to be added is larger than the searched child record, the searched child record is in the last order. Here, when a plurality of order keys are specified in the record storage order definition 52, when the field value is equal in the comparison with a certain key (the nth key), the comparison with the next key (the n + 1th key) is performed. I do. If the retrieved child record is in the order after the record data to be added (Y in step 904), the position of the record data to be added is determined before the child record (step 90).
5), end the processing. On the other hand, if the searched child record is not in the order after the record data to be added (N in step 904), the next child record in the chain is searched (step 906), and the process returns to the end of the chain determination (step 902). . The above is the processing for determining the addition position of the child record.

【0013】図10は、図6のレコード格納順序定義5
2に基づき、図7の「応募情報」テーブルで71「INSE
RT INTO 応募情報 VALUES('第1回','木村xx','東京都
北区','03-8765-xxxx','1999/10/12 14:25:24')」のよ
うな検索文で行の追加を試みた場合の(データベースで
のレコードの追加を含めた)様子を示している。仮想的
なテーブル71中に追加した行データに対応して子レコ
ード(応募者情報のレコード)がチェインに追加されて
いる。図中で追加した行及びレコードは網掛けで示し、
それに伴って付替えられたリンクは太い矢印で示してい
る。キーフィールド「回次」の値が「第1回」の親レコ
ード(応募回次情報のレコード)は既に存在するため、
親レコードの追加は行われない。子レコードの追加は、
「回次」の値が「第1回」の親レコードのチェインに行
われる。チェイン内での追加位置は図6のレコード格納
順序定義52の項目522(「フィールド」及び「昇順
/降順」)の指定に従ってレコードが「エントリ日時」
の「昇順」になるように決定している。
FIG. 10 shows the record storage order definition 5 shown in FIG.
2 and 71 in the “Application Information” table in FIG.
RT INTO application information VALUES ('1st', 'Kimura xx', 'Kita-ku, Tokyo', '03-8765-xxxx', '1999/10/12 14:25:24') This shows how the statement tried to add a row (including adding a record in the database). Child records (records of applicant information) are added to the chain corresponding to the row data added in the virtual table 71. Lines and records added in the figure are shaded,
The links replaced accordingly are indicated by thick arrows. Since the parent record (record of the application round information) whose key field “round” value is “1st” already exists,
No parent record is added. Adding child records
The value of “second” is performed in the chain of the “first” parent record. The addition position in the chain corresponds to the entry “date and time” according to the specification of the item 522 (“field” and “ascending / descending order”) of the record storage order definition 52 in FIG.
Is determined to be “ascending order”.

【0014】[0014]

【発明の効果】以上の説明から明らかなように、本発明
によれば、SQL言語で取り扱うテーブルとネットワーク
型データベースのレコードデータの対応付けに関する定
義情報の中にレコードデータの格納順序に関する情報、
詳しくは、順序指定のためのフィールド名とフィールド
値の昇順または降順で示した順序の種別の組等を持た
せ、レコードの追加処理を行う際に、この格納順序に関
する情報に従ってレコードの追加位置を決定すること
で、ネットワーク型データベースのSQL言語を用いた操
作インタフェースによる追加位置の指定が可能なレコー
ドの追加を実現している。これにより、SQL言語を利用
した操作インタフェース自体はリレーショナルデータベ
ースで用いるもののままで、ネットワーク型データベー
ス特有のレコードの意味付けに対応した操作が可能にな
るという効果を得ることができる。
As is clear from the above description, according to the present invention, the definition information relating to the correspondence between the table handled in the SQL language and the record data of the network type database includes information on the storage order of the record data,
For details, a set of a field name for specifying the order and a type of order indicated in ascending or descending order of the field value, etc. is provided, and when performing the record adding process, the record adding position is determined according to the information on the storage order. By deciding, the record whose addition position can be specified by the operation interface using the SQL language of the network type database is realized. As a result, it is possible to obtain an effect that an operation corresponding to the meaning of a record unique to a network-type database can be performed while an operation interface using the SQL language itself is used in a relational database.

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

【図1】本発明のデータベースシステムの実施の形態を
示すブロック構成図である。
FIG. 1 is a block diagram showing an embodiment of a database system according to the present invention.

【図2】ネットワーク型データベースのレコード間の親
子関連を示す図である。
FIG. 2 is a diagram showing a parent-child relationship between records in a network database.

【図3】ネットワーク型データベース内のレコードデー
タの内容例を示す図である。
FIG. 3 is a diagram showing an example of the contents of record data in a network database.

【図4】ネットワーク型データベースのデータベース定
義の例を示す図である。
FIG. 4 is a diagram illustrating an example of a database definition of a network-type database.

【図5】テーブル定義格納装置のレコード=行対応定義
の例を示す図である。
FIG. 5 is a diagram illustrating an example of a record = row correspondence definition in a table definition storage device.

【図6】テーブル定義格納装置のレコード格納順序定義
の例を示す図である。
FIG. 6 is a diagram illustrating an example of a record storage order definition of a table definition storage device.

【図7】データベースのレコードデータと仮想的なテー
ブルの対応を示す図である。
FIG. 7 is a diagram showing correspondence between record data of a database and a virtual table.

【図8】SQL(INSERT文)でデータベースにレ
コードを追加する処理のフロー図である。
FIG. 8 is a flowchart of a process of adding a record to a database in SQL (INSERT statement).

【図9】レコードの追加処理のうち、子レコードの追加
位置を決定する処理の詳細フロー図である。
FIG. 9 is a detailed flowchart of a process of determining a child record addition position in a record addition process.

【図10】データベースへのレコードの追加(仮想的な
テーブルへの行の追加)を試みた場合のテーブルデータ
及びレコードデータの変化の例を示す図である。
FIG. 10 is a diagram illustrating an example of changes in table data and record data when an attempt is made to add a record to a database (add a row to a virtual table).

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

1…入出力装置、2…操作要求受付部、3…操作要求変
換部、4…データベース、5…テーブル定義格納装置、
7…データベース制御装置、41…レコードデータ、4
2…データベース定義、51…レコード=行対応定義、
52…レコード格納順序定義。
DESCRIPTION OF SYMBOLS 1 ... I / O device, 2 ... Operation request reception part, 3 ... Operation request conversion part, 4 ... Database, 5 ... Table definition storage device,
7 ... Database controller, 41 ... Record data, 4
2 ... database definition, 51 ... record = row correspondence definition,
52: Record storage order definition.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 ネットワーク型データベースをSQL言語
インタフェースで参照および更新するデータベース制御
装置であって、 SQL言語で取り扱うテーブルとネットワーク型データベ
ースのレコードデータの対応付けに関する定義情報の中
に、レコードデータの格納順序に関する定義情報を保持
した記憶手段を備えることを特徴とするデータベース制
御装置。
1. A database control device for referencing and updating a network-type database with an SQL language interface, wherein record data is stored in definition information relating to correspondence between a table handled in the SQL language and record data of the network-type database. A database control device comprising storage means for holding definition information on an order.
【請求項2】 レコードの追加処理を行う際に、前記レ
コードデータの格納順序に関する定義情報に従ってレコ
ードの追加位置を決定する手段を備えることを特徴とす
る請求項1に記載のデータベース制御装置。
2. The database control apparatus according to claim 1, further comprising: means for determining a record addition position in accordance with definition information on a storage order of the record data when performing a record addition process.
【請求項3】 前記レコードデータの格納順序に関する
定義情報は、順序指定のためのフィールド名とフィール
ド値の昇順または降順で示した順序の種別からなること
を特徴とする請求項1または2に記載のデータベース制
御装置。
3. The method according to claim 1, wherein the definition information relating to the storage order of the record data includes a field name for specifying the order and a type of the order shown in ascending or descending order of the field value. Database controller.
【請求項4】 ネットワーク型データベースをSQL言語
インタフェースで参照および更新するシステムであっ
て、 SQL言語で取り扱うテーブルとネットワーク型データベ
ースのレコードデータの対応付けに関する定義情報の中
に、レコードデータの格納順序に関する定義情報を保持
した記憶手段を備えることを特徴とするデータベースシ
ステム。
4. A system for referencing and updating a network-type database with an SQL language interface, wherein the definition information relating to the correspondence between a table handled in the SQL language and record data of the network-type database relates to the storage order of record data. A database system comprising storage means for holding definition information.
JP2000088694A 2000-03-28 2000-03-28 Method and system for controlling database Pending JP2001273178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000088694A JP2001273178A (en) 2000-03-28 2000-03-28 Method and system for controlling database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000088694A JP2001273178A (en) 2000-03-28 2000-03-28 Method and system for controlling database

Publications (1)

Publication Number Publication Date
JP2001273178A true JP2001273178A (en) 2001-10-05

Family

ID=18604535

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000088694A Pending JP2001273178A (en) 2000-03-28 2000-03-28 Method and system for controlling database

Country Status (1)

Country Link
JP (1) JP2001273178A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008257570A (en) * 2007-04-06 2008-10-23 Ntt Data Corp Database system and program
JP2015200978A (en) * 2014-04-04 2015-11-12 富士通株式会社 Database access control program, database access control method, and information processing device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008257570A (en) * 2007-04-06 2008-10-23 Ntt Data Corp Database system and program
JP2015200978A (en) * 2014-04-04 2015-11-12 富士通株式会社 Database access control program, database access control method, and information processing device

Similar Documents

Publication Publication Date Title
US6240422B1 (en) Object to relational database mapping infrastructure in a customer care and billing system
US5437038A (en) System and method of encoding units of data including entity/relationship data, function calls, and file data using a common data format (CDF) according to formal CDF grammar rules
CN112650766B (en) Database data operation method, system and server
US7668888B2 (en) Converting object structures for search engines
WO2005104456A1 (en) Fixed length data search device and search management method
US5943665A (en) Method and system for performing conceptual joins across fields of a database
US6003025A (en) Data transformer system for accessing database information
JP2001273178A (en) Method and system for controlling database
US7984045B2 (en) Scalable data extraction from data stores
US20040205591A1 (en) Method and program for XML data conversion
US20060253833A1 (en) System and method for efficient hosting of wireless applications by encoding application component definitions
US6510423B1 (en) Method and device for object control with a plurality of operation-target flags
JPH0619756A (en) Edi format conversion method
JP4473026B2 (en) Data exchange computer
JP5696280B1 (en) Term unification system, term unification program, and term unification method
JP2990312B2 (en) Data access method and device
US8849866B2 (en) Method and computer program product for creating ordered data structure
JP2000267909A (en) Database system
JP2002132551A (en) Database system
JP3555542B2 (en) Group number setting device and group number setting method
JP3337717B2 (en) Database processing device and database processing method
JP3224159B2 (en) Expert system
JPH08328924A (en) Index updating system
JPH11259351A (en) Data base device, shared data base device, shared data base system, data extracting method for shared data base device and storage medium recording data extraction program for shared data base device
JPH10133930A (en) Data base system