JP2004318342A - Database system, data processing method, and database program - Google Patents

Database system, data processing method, and database program Download PDF

Info

Publication number
JP2004318342A
JP2004318342A JP2003109365A JP2003109365A JP2004318342A JP 2004318342 A JP2004318342 A JP 2004318342A JP 2003109365 A JP2003109365 A JP 2003109365A JP 2003109365 A JP2003109365 A JP 2003109365A JP 2004318342 A JP2004318342 A JP 2004318342A
Authority
JP
Japan
Prior art keywords
group
record
database
data
range data
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
JP2003109365A
Other languages
Japanese (ja)
Inventor
Shin Kuramochi
伸 倉持
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to JP2003109365A priority Critical patent/JP2004318342A/en
Publication of JP2004318342A publication Critical patent/JP2004318342A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a database system, a data processing method and a database program for efficiently inserting data by recording the range of each group in a database. <P>SOLUTION: A detail chart H1 is the chart of a database in which the data of one or more items are stored for every record. A title chart H0 is a preserving means for preserving range data showing the range of records for every group for the records stored in the detail chart H1, and sequenced for every group where the values of predetermined key items are made common, and the title chart H0 is defined as a second chart different from the detail chart H1. An adding part 2 is an adding means for adding new records to the database DB by executing processing to specify at least either the group or an inserting position in the group based on the above range data. An updating part 3 updates the range data based on the above addition. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、データベース中の各グループの範囲を記録しておくことで、効率良くデータ挿入を行うデータベースシステム、データ処理方法及びデータベースプログラムに関する。
【0002】
【従来の技術】
近年、ビジネスなどの情報処理分野で、リレーショナルデータベースが普及している(例えば、特許文献1参照)。リレーショナルデータベースは、例えば氏名、生年月日といったいくつかの情報項目を、レコード数分並べた「表」を単位としたデータベースで、いわゆる表計算ソフトによって実現される場合も含むものとする。このようなリレーショナルデータベースにおける「表」は、必要な場合に所望のキー項目でソートし直すことが可能であるが、利用目的に応じて処理によく使う項目はある程度決まってくるものであり、また、ソートの所要時間もレコード数に応じ増大する特徴がある。したがって、表中の行にあたるレコードは、利用目的に応じて、必要な項目の値が共通するグループの順に並べておくことが望ましい。
【0003】
【特許文献1】
特開2001−331353
【0004】
【発明が解決しようとする課題】
この前提で新しいレコードの追加を考える場合、データ量が多いと時間がかかり迅速性に欠ける問題があった。すなわち、まず、通常の一般的なレコードの追加処理では、追加位置は表の最後となるので、追加されたレコードを、本来属すべきグループすなわち同じ項目値を持つレコード集団に移動させるには、必要なキー項目で表全体をソートし直す必要があり、データ量に応じソート時間がかかる問題があった。また、この場合、次に使うときに同様のソートを不要にするためには、ソートしたままの順序で別の表へ書き出し、元の表を削除して新しい方を読み込むことで表を書き換えるなどの作業も要し煩雑であった。
【0005】
また、上記のようなソート処理を使わない手法としては、いったんグループごとに綺麗に並んだ状態を確保したら、その後はレコード追加をしかるべき挿入位置にだけ行う手法もある。すなわち、追加しようとする新たなデータの項目値をもとに、入力者が事前にカーソル操作で確認しながら、表中から属すべきグループと挿入位置を手作業で探し、レコード間に挿入することでレコードがきれいに並んだ状態を維持するものである。しかしながら、カーソルをスクロールさせながら肉眼で探すようなこの種の手作業は、速さと正確さに限界があるだけでなく、データ件数が多いほど長時間かかり、挿入位置を間違える可能性などの問題もあった。
【0006】
これに対し、しかるべき挿入位置をコンピュータ処理で探させる手法もあるが、追加しようとする項目の値に一致するレコードを表中から探すには、実装システムの機能に応じて、「検索」や「選択」の処理を用いることになる。一般に、前者の「検索」処理は、先頭のレコードから一つずつ条件と一致するかどうか判別させる処理であるため、一致するレコードが表の下方にあり、レコード数が多い場合には時間がかかる問題があった。
【0007】
また、後者の「選択」処理は、選択すべきグループを事前に条件指定させ、それに該当する各レコードの集団を画面に呼び出す処理で、そのように表示されたうち所望の個所に行すなわちレコードを登録することになる。しかし、「選択」は予めソートされたデータに対して行う方が速く、選択の前に結局ソート処理が必要になってやはり迅速性に欠ける問題があった。
【0008】
また、選択状態で表示されたレコードから挿入位置を指定しても、その位置は選択されたグループ内や画面上のもので、データベースの表中の位置とは異なるため、選択状態ではそもそもレコード挿入ができないシステムもある。その場合、レコードの挿入による追加を行う段になれば結局、選択状態を解除せざるを得ず、選択状態での挿入位置をデータベース中で確認する二度手間も問題であった。
【0009】
本発明は、上記のような従来技術の問題点を解決するために提案されたもので、その目的は、データベース中の各グループの範囲を記録しておくことで、効率良くデータ挿入を行うデータベースシステム、データ処理方法及びデータベースプログラムを提供することである。
【0010】
【課題を解決するための手段】
上記の目的を達成するため、請求項1の発明は、一以上の各項目のデータをレコードごとにデータベースの表に格納するデータベースシステムにおいて、所定の項目の値が共通するグループごとに順列した前記レコードについて、各グループごとのレコードの範囲を表す範囲データを保持する保持手段と、前記データベースに新たなレコードを追加する際、該当するグループ又はグループ中の挿入位置の少なくとも一方を特定する処理を、前記範囲データに基いて行う追加手段と、前記追加に基いて前記範囲データを更新する更新手段と、を備えたことを特徴とする。
【0011】
請求項9の発明は、請求項1の発明を方法という見方から捉えたもので、一以上の各項目のデータをレコードごとにデータベースの表に格納するデータ処理方法において、所定の項目の値が共通するグループごとに順列した前記レコードについて、各グループごとのレコードの範囲を表す範囲データを保持する保持処理と、前記データベースに新たなレコードを追加する際、該当するグループ又はグループ中の挿入位置の少なくとも一方を特定する処理を、前記範囲データに基いて行う追加処理と、前記追加に基いて前記範囲データを更新する更新処理と、をコンピュータが行うことを特徴とする。
【0012】
請求項17の発明は、請求項1,9の発明をコンピュータのプログラムという見方から捉えたもので、コンピュータを制御することにより、一以上の各項目のデータをレコードごとにデータベースの表に格納させるデータベースプログラムにおいて、そのプログラムは前記コンピュータに、所定の項目の値が共通するグループごとに順列した前記レコードについて、各グループごとのレコードの範囲を表す範囲データを保持させ、前記データベースに新たなレコードを追加する際、該当するグループ又はグループ中の挿入位置の少なくとも一方を特定する処理を、前記範囲データに基いて行わせ、前記追加に基いて前記範囲データを更新させることを特徴とする。
【0013】
これらの態様では、グループごとの行番号などレコードの範囲を範囲データとして保持及び更新するので、次のレコード追加時に、グループや挿入位置を画面表示してユーザに選択させるなどの処理を、範囲データを利用して迅速に行うことができ、処理が大幅に効率化される。
【0014】
請求項2の発明は、請求項1記載のデータベースシステムにおいて、前記範囲データは、各グループのレコード件数を含むことを特徴とする。
【0015】
請求項10の発明は、請求項2の発明を方法という見方から捉えたもので、請求項9記載のデータ処理方法において、前記範囲データは、各グループのレコード件数を含むことを特徴とする。
【0016】
これらの態様では、特に、各グループのレコード件数が範囲データから直接得られる利点がある。また、所望のグループについて、最初となる開始レコード番号は直前までのレコード件数の積算に1加えて容易に得られ、また、最後となる最終レコード番号もそのグループまでのレコード件数の積算により容易に特定できる。
【0017】
請求項3の発明は、請求項1又は2記載のデータベースシステムにおいて、前記範囲データは、各グループの開始レコード番号を含むことを特徴とする。
【0018】
請求項11の発明は、請求項3の発明を方法という見方から捉えたもので、請求項9又は10記載のデータ処理方法において、前記範囲データは、各グループの開始レコード番号を含むことを特徴とする。
【0019】
これらの態様では、特に、各グループの最初となる開始レコード番号が範囲データから直接得られる利点がある。また、所望のグループについて、最後となる最終レコード番号は直後のグループの開始レコード番号から1減じて容易に得られ、また、レコード件数も直後のグループの開始レコード番号から該当グループの開始レコード番号を減じて容易に特定できる。
【0020】
請求項4の発明は、請求項1から3のいずれかに記載のデータベースシステムにおいて、前記範囲データは、各グループの最終レコード番号を含むことを特徴とする。
【0021】
請求項12の発明は、請求項4の発明を方法という見方から捉えたもので、請求項9から11のいずれかに記載のデータ処理方法において、前記範囲データは、各グループの最終レコード番号を含むことを特徴とする。
【0022】
これらの態様では、特に、各グループの最後となる最終レコード番号が範囲データから直接得られる利点がある。また、所望のグループについて、開始レコード番号は直前のグループの最終レコード番号に1加えて容易に得られ、また、レコード件数も該当グループの最終レコード番号から直前のグループの最終レコード番号を減じて容易に特定できる。
【0023】
請求項5の発明は、請求項1から4のいずれかに記載のデータベースシステムにおいて、前記追加手段は、前記保持手段から前記範囲データを取り出し、その範囲データに基いて各グループを画面表示するとともに所望のグループの選択を受け付け、選択されたグループの各レコードを画面表示するとともに前記新たなレコードの挿入位置の指定を受け付け、前記新たなレコードについて、各項目のデータの入力を受け付けるとともに、指定された前記挿入位置に挿入することにより追加を行い、前記更新手段は、前記追加に基いて前記範囲データの更新を行うことを特徴とする。
【0024】
請求項13の発明は、請求項5の発明を方法という見方から捉えたもので、請求項9から12のいずれかに記載のデータ処理方法。において、前記追加処理は、前記範囲データに基いて各グループを画面表示するとともに所望のグループの選択を受け付け、選択されたグループの各レコードを画面表示するとともに前記新たなレコードの挿入位置の指定を受け付け、前記新たなレコードについて、各項目のデータの入力を受け付けるとともに、指定された前記挿入位置に挿入することにより追加を行い、前記更新処理は、前記追加に基いて前記範囲データの更新を行うことを特徴とする
【0025】
請求項18の発明は、請求項5,13の発明をコンピュータのプログラムという見方から捉えたもので、請求項17記載のデータベースプログラムにおいて、前記レコードの追加にあたり、前記プログラムは前記コンピュータに、前記範囲データに基いて各グループを画面表示させるとともに所望のグループの選択を受け付けさせ、選択されたグループの各レコードを画面表示させるとともに前記新たなレコードの挿入位置の指定を受け付けさせ、前記新たなレコードについて、各項目のデータの入力を受け付けさせるとともに、指定された前記挿入位置に挿入させることにより追加を行わせ、前記追加に基いて前記範囲データの更新を行わせることを特徴とする。
【0026】
これらの態様では、範囲データの活用により、グループの表示及び選択、グループ内のレコードの表示と挿入位置の指定、実際の挿入と範囲データの更新に至る一連の処理が円滑に進行する利点があり、レコード追加が大幅に効率化される。
【0027】
請求項6の発明は、請求項5記載のデータベースシステムにおいて、前記追加手段は、選択された前記グループの各レコードを、前記データベース中のレコード番号とは異なる所定のローカル位置番号で特定される所定の選択状態で、前記表示及び挿入位置の指定の対象とし、前記挿入位置が指定されると、前記選択状態を解除するとともに、指定された挿入位置をローカル位置番号から前記データベース中のレコード番号に換算することにより新しいレコードの挿入を行うように構成されたことを特徴とする。
【0028】
請求項14の発明は、請求項6の発明を方法という見方から捉えたもので、請求項13記載のデータ処理方法において、前記追加処理は、選択された前記グループの各レコードを、前記データベース中のレコード番号とは異なる所定のローカル位置番号で特定される所定の選択状態で、前記表示及び挿入位置の指定の対象とし、前記挿入位置が指定されると、前記選択状態を解除するとともに、指定された挿入位置をローカル位置番号から前記データベース中のレコード番号に換算することにより新しいレコードの挿入を行うことを特徴とする。
【0029】
請求項19の発明は、請求項6,14の発明をコンピュータのプログラムという見方から捉えたもので、請求項18記載のデータベースプログラムにおいて、前記追加にあたり、前記プログラムは前記コンピュータに、選択された前記グループの各レコードを、前記データベース中のレコード番号とは異なる所定のローカル位置番号で特定される所定の選択状態で、前記表示及び挿入位置の指定の対象とさせ、前記挿入位置が指定されると、前記選択状態を解除させるとともに、指定された挿入位置をローカル位置番号から前記データベース中のレコード番号に換算させることにより新しいレコードの挿入を行わせることを特徴とする。
【0030】
これらの態様では、選択状態のままでは行挿入等のレコード挿入が行えない場合も、挿入位置の指定後に選択状態を解除し、挿入位置指定時の番号をデータベース中のレコード番号に換算してレコード挿入を行える利点があり、幅広い多様なシステムを適用対象とすることができる。特に、従来では選択状態のまま入力すれば表の最後への追加となり再ソートをはじめとする煩雑な処理を要したところそれが不要となる。
【0031】
請求項7の発明は、請求項1から6のいずれかに記載のデータベースシステムにおいて、前記保持手段は、前記範囲データを、所定の変数に保持することを特徴とする。
【0032】
請求項15の発明は、請求項7の発明を方法という見方から捉えたもので、請求項9から14のいずれかに記載のデータ処理方法において、前記保持処理は、前記範囲データを、所定の変数に保持することを特徴とする。
【0033】
これらの態様では、最初や最後のレコード番号や件数、グループ分けの基準となる項目であるキー項目などの範囲データを変数に保持するので、データベースシステムが扱う表の数を減らし、システムの単純化や負担軽減が可能となる利点がある。
【0034】
請求項8の発明は、請求項1から7のいずれかに記載のデータベースシステムにおいて、前記保持手段は、前記範囲データを、前記表とは異なる第2の表に保持することを特徴とする。
【0035】
請求項16の発明は、請求項8の発明を方法という見方から捉えたもので、請求項9から15のいずれかに記載のデータ処理方法において、前記保持処理は、前記範囲データを、前記表とは異なる第2の表に保持することを特徴とする。
【0036】
請求項20の発明は、請求項8,16の発明をコンピュータのプログラムという見方から捉えたもので、請求項17から19のいずれかに記載のデータベースプログラムにおいて、前記プログラムは前記コンピュータに、前記範囲データを、前記表とは異なる第2の表に保持させることを特徴とする。
【0037】
これらの態様では、範囲データについても、目的の表と同じデータベースの別の表に保持するので、同じデータベースシステムの機能で容易に扱える利点がある。特に、グループ分けのキー項目について、表中での繰り返しが回避できるので、データのいわゆる正規性が維持され、キー項目を検索したり表示等する処理が大幅に効率化される。
【0038】
【発明の実施の形態】
次に、本発明の実施の形態(以下「実施形態」と呼ぶ)について図面を参照して具体的に説明する。本実施形態におけるデータベースシステム(以下「本システム」と呼ぶ)は、必要な周辺装置を備えたコンピュータをプログラムで制御することにより実現でき、この場合のハードウェアやプログラムの実現態様は各種変更可能である。また、実施形態は、装置に加え、方法、コンピュータプログラム、そのようなプログラムを記録したコンピュータ読取可能な記録媒体としても把握可能である。このように本実施形態の実現態様は各種考えられるので、以下の説明では、本発明及び本実施形態の各機能を実現する仮想的回路ブロックを用いる。
【0039】
〔1.構成〕
〔1−1.全体構成〕
本システムは、一以上の各項目のデータをレコードごとにデータベースの表に格納するデータベースシステムで、上記のようなプログラムの作用により、図1の機能ブロック図に示すように、データベースDBの表として、見出し表H0及び明細表H1を保持し、また、下記の各要素を備える。
【0040】
まず、明細表H1は、一以上の各項目のデータをレコードごとに格納するデータベースの表である。そして、見出し表H0は、明細表H1に格納されグループ分けの基準となる項目である所定のキー項目の値が共通するグループごとに順列した前記レコードについて、各グループごとのレコードの範囲を表す範囲データを保持する保持手段であり、明細表H1とは異なる第2の表となっている。
【0041】
まず、RDBMS(リレーショナル・データベース・マネジメント・システム)などを用いる検索等管理部Mでは、上記プログラムの作用により、追加部2及び更新部3が実現される。このうち追加部2は、前記データベースに新たなレコードを追加する際、該当するグループ又はグループ中の挿入位置の少なくとも一方を特定する処理を、前記範囲データに基いて行う追加手段である。また、更新部3は、前記追加に基いて前記範囲データを更新する更新手段である。
【0042】
また、本システムは、入出力手段として液晶表示パネル等の表示部4と、マウスやキーボード等の操作部5と、を備える。このうち表示部4は、グループやレコード、データ等の情報出力に用いられ、操作部5は、操作や指示の入力、レコードの選択、挿入位置の指定、データの入力などに用いられる。
【0043】
〔1−2.範囲データの表し方〕
本実施形態において、範囲データの表し方は自由であるが、典型的には、各グループを分ける基準となっている項目であるキー項目の値すなわちキー項目値とともに、それに対応したレコード件数、開始レコード番号、最終レコード番号、のうちいずれか又は複数を含むことが考えられる。例えば、レコード件数を用いる態様では、特に、各グループのレコード件数が範囲データから直接得られる利点がある。また、所望のグループについて、最初となる開始レコード番号は直前までのレコード件数の積算に1加えて容易に得られ、また、最後となる最終レコード番号もそのグループまでのレコード件数の積算により容易に特定できる。
【0044】
また、開始レコード番号を用いる態様では、特に、各グループの最初となる開始レコード番号が範囲データから直接得られる利点がある。また、所望のグループについて、最後となる最終レコード番号は直後のグループの開始レコード番号から1減じて容易に得られ、また、レコード件数も直後のグループの開始レコード番号から該当グループの開始レコード番号を減じて容易に特定できる。
【0045】
また、最終レコード番号を用いる態様では、特に、各グループの最後となる最終レコード番号が範囲データから直接得られる利点がある。また、所望のグループについて、開始レコード番号は直前のグループの最終レコード番号に1加えて容易に得られ、また、レコード件数も該当グループの最終レコード番号から直前のグループの最終レコード番号を減じて容易に特定できる。
【0046】
本実施形態では、レコード番号を「行番号」「行番」のようにも呼ぶこととし、また、各グループごとの範囲データは、開始レコード番号及びレコード件数であるものとする。
【0047】
〔2.作用〕
〔2−1.作用の概略〕
上記のように構成された本実施形態では、追加部2が、データベースDBに新たなレコードを追加する際、該当するグループ及びグループ中の挿入位置を特定する処理を、見出し表H0に格納された前記範囲データに基いて行う。そして、更新部3は、そのような追加に基いて見出し表H0の範囲データを更新する。
【0048】
具体的には、図2のフローチャートに示すように、追加部2は、
(1)見出し表H0から前記範囲データすなわちグループごとの行番と件数を取り出し、その範囲データに基いて各グループを画面表示するとともに所望のグループの選択を受け付け(ステップ1)、
(2)選択されたグループの各レコードの呼出しすなわち画面表示を行うとともに(ステップ2)前記新たなレコードの挿入位置の指定を受け付け(ステップ3)、
(3)前記新たなレコードについて、各項目のデータの入力を受け付けるとともに、指定された前記挿入位置に挿入処理することで追加を行い(ステップ4)、(4)更新部3は、そのような追加に基いて、影響が及ぶ各グループの範囲データである行番と件数の更新を行う(ステップ5)。
【0049】
このように、本実施形態では、範囲データの活用により、グループの表示及び選択、グループ内のレコードの表示と挿入位置の指定、実際の挿入と範囲データの更新に至る一連の処理が円滑に進行する利点があり、レコード追加が大幅に効率化される。
【0050】
〔2−2.簡単な例〕
ここで、範囲データを活用した処理の簡単な例を示す。例えば、各グループのレコード件数をグループ単位にカウントすると、各グループが始まる行番がわかる。例えば、aグループで4件、bグループで3件、cグループで2件のレコードが上から順に並んでいる場合、cグループが始まる行番は、それ以前のグループaとbの各件数の合計に1を加えた「8」となる。
【0051】
なお、この例ではcグループ以前の合計レコード件数が7件に過ぎないため計算容易であるが、グループ数やレコード数が多いほど計算所要時間は増大するので、本実施形態では、レコード追加の都度、件数と行番を最新の値に更新し、見出し表H0に記録することで処理を効率化する。このようにすれば、追加分と同じグループのレコードを画面に呼び出すような時、画面に呼び出すべきグループの行番号範囲を記録済みの情報を参照するだけで瞬時に特定できる。
【0052】
〔2−3.具体例〕
ここで、以下の説明で用いるデータの例を示す。この例は社員情報システムであり、社員の名前や生年月日等の個人情報を、部課ごとのグループで管理する。具体的には、各社員について取り扱うデータ項目は、「地区」、「部」、「課」、「名前」、「生年月日」、「性別」、「役職名」、「出身地」であり、そのうち名前以降の個人固有情報は、図3に示すような各項目を単位とした一人ずつのレコードとして、明細表H1に格納する。
【0053】
また、それらレコードは、所定のキー項目値の共通するもの同士を同じグループとするが、グループごとに共通するキー項目としては上記のデータ項目から個人固有情報を除いた「地区」、「部」、「課」を用いる。そして、見出し表H0に、項目としてグループ番号(図中「グ番号」)と、グループ番号に対応するそれぞれのキー項目値「地区」、「部」、「課」と、それに対応するグループに属するレコードの「行番」すなわち開始レコード番号と「件数」を、図4に示すようなレコードごとの範囲データとして格納する。
【0054】
また、これらの情報の画面表示の例を図5に示す。すなわち、画面上部には、表示するグループのキー項目値を表示し、この部分を「見出し部」と呼ぶ。この部分の表示内容は、その下に表示させるレコードの出力条件となっている。そして、見出し部の下のグループのレコードを表示する部分を「明細部」と呼ぶ。明細部に表示するレコードの範囲については、見出し表H0に格納されたそのグループの範囲データに基き、最初の位置は「行番」で直接把握し、終わりの位置は行番に「件数」を加えて計算される。
【0055】
そして、新しいデータが任意の挿入位置すなわち行間に追加されると、そのグループとそれ以降の行番と件数が変わり、この更新後の値が見出し表H0内の範囲データに反映され、次回のグループごとの画面表示に利用される。このような範囲データを用いたレコード追加について、概略を図6の概念図に示し、また、その処理手順について、以下、図2に示した各ステップに沿って説明する。
【0056】
〔2−4.行番と件数の取り出し及びグループ選択〕
すなわち図2のステップ1では、まず、図7のフローチャートに示すように、見出し部用のデータが保存されている見出し表H0を開き、その項目のうち「グ番号」に加え、キー項目値である「地区」、「部」、「課」を射影により取り出し、画面上に各グループごとのキー項目値の一覧を、画面上にファイル出力すなわち表示させる(ステップ11)。射影により画面(図8)には「グ番号」、「地区」、「部」、「課」が表示され、「行番」及び「件数」は表示されない。
【0057】
このように表示された画面上のグループ候補一覧から、ユーザに、追加しようとするレコードのデータが属すべきグループを指定させると(ステップ12)、指定されたグループの各キー項目値と、「件数」と、そのグループの開始レコード番号である「行番」が、それぞれ対応する変数にコピーされる(ステップ13,14)。なお、本実施形態において変数は「h〜」で始まる名称や略称で適宜表す。
【0058】
図8の例は、そのように選択可能な複数のグループが画面表示された配属先の指定画面であり、この画面上で矢印で示す行、すなわち7行目のグ番号「7」、地区「横浜支社」、部「総務部」、課「2」の行にカーソルを移し、実行キーの入力など所定の操作を行う、画面に表示しない右側の二列の項目から、指定されたグループに対応する行番「800」と件数「7」のペアが一組だけ、それぞれ所定の変数例えばh行番、h件数に代入される。
【0059】
また、見出し表H0の内容は、メモリ上の配列変数にいったん呼び出しておけば、見出し表H0へのアクセス無しで複数のグループにレコードが追加できるなど、その後の処理が効率化でき、その場合の行番と件数の取り出し及びグループ選択の処理手順を図9に示す。
【0060】
この手順では、見出し表H0の(ステップ101)トップから(ステップ102,103)終端行まで(ステップ107)、グループ番号を格納する変数hグ番号をループ制御変数として0から(ステップ103)インクリメントしながら(ステップ104)、見出し表H0中の[位置]を、hグ番号を添字とした配列変数h行番[hグ番号]へ代入し(ステップ105)カーソルを一行ずつ移動させる(ステップ106)。
【0061】
カーソルが終端行を過ぎると(ステップ107)、さらに、最後のhグ番号を最終レコード番号である変数h終グ番号に代入し(ステップ108)、射影及び出力(ステップ109)、グループの指定すなわち選択(ステップ110)を経て、選択された[グループ番号]を変数hグ現番号とし、表を閉じる(ステップ112)。
【0062】
〔2−5.レコードの呼出〕
上記のように選択したグループ番号と、それに対応して取り出し所定の変数に記録した行番と件数の情報から、対象となるレコードを呼び出す処理(図2のステップ2)の手順を図10のフローチャートに示す。なお、フローチャート中での破線は図9のように配列変数を用いる場合に関するものであり、以下のフローチャートでも同様である。
【0063】
図10の手順では、まず、明細表H1を開いたうえ(ステップ21)、指定したグループが始まる位置は、行番でもって把握し、カーソルを該当レコードへ移動させる(ステップ22)。その結果、表のトップからそのレコードの一つ手前にあたる行までのレコード検索が不要になるので、入力済みデータの件数や容量とはほとんど関係なく、選択したグループのレコードを画面呼出することが可能となる。
【0064】
例えば、図11の概念図に示す例では、指定したグループ7の開始レコード番号である行番が800行目なので、799行分の検索処理が省略できる。また、レコードは、グループの最終レコード番号まで、キー項目の昇順や降順で連続して並んでいるので、そのグループに属するものとして表示すべき最終レコード番号は、そのグループの始まる「行番」に、それまでに入力済みのグループ内レコードの「件数」を加えたものとみなしてグループの範囲を特定し、その範囲を選択状態にして、瞬時に画面表示を行える(ステップ23)。なお、本実施形態における選択状態は「行数選択」と呼ぶ。
【0065】
その結果、図11の例では、選択グループ7より後の行番807から表の終わる900行目までの検索も全て不要になる。なお、各時点でポインタすなわちカーソルが指しているレコードを「カレントレコード」と呼ぶ。
【0066】
このようにレコードを画面表示するとともに、画面上部に見出し部の変数値すなわち項目値を表示し(ステップ24)、操作選択のためのキー入力を受け付ける(ステップ30)。図10の例では、状態検出用のいくつかの変数、すなわちh区分、h区分行、h区分状態、h区分ボタンの状態に応じていくつかの処理に分岐する(ステップ31〜35)。このようなユーザインタフェースは自由に設計でき、例えば、プログラム構成によるが、行間挿入のためには、挿入キーを押した時点でカーソルがいずれかの行や行間も指していなければ、「カレント行を指定して下さい」等の要求を出力してもよい。なお、複数のグループの範囲データを配列変数に読み込み済(図9)の場合は、例えば「他グループ編集」を選ぶことにより、続けて他のグループについてもレコード追加等の編集が可能である。
【0067】
〔2−6.挿入位置の指定〕
但し、以上のようなユーザインタフェースの設計は一例に過ぎず自由に変更可能であり、重要なことは、ユーザは選択したグループのレコード間から、所望の挿入位置を指定できることである(図2のステップ3)。例えば、図5の状態でユーザはキー操作により、上下のカーソル移動により所望のレコード間を指定したうえ、挿入キーを押すなど所定の操作を行うと(図10のステップ31)、そのときカーソルが指していたレコード間の位置を挿入位置として(ステップ32)、行挿入処理へ移行する(ステップ35)。
【0068】
例えば、図5の例は、新しく入社する社員の配属先として、横浜支社の総務部第2課を選択し(図8)その各レコードを画面に表示した状態であり、このグループ内の各レコードは生年月日の昇順に順列している。この場合、新しく入力するレコードが昭和32年生まれに関する場合、図5に矢印で示すように、3行目と4行目の間をカーソルで指定し、挿入キーを押すことで挿入位置が指定される。
【0069】
ところで、追加部2による上記のような表示及び挿入位置の指定は、対象グループの各レコードを選択した選択状態で行われるが、この選択状態は、選択されたグループの各レコードを、データベースDB中のレコード番号とは異なる所定のローカル位置番号で特定する状態である。このため、追加部2は、挿入位置が指定されると、そのような選択状態を解除するとともに、指定された挿入位置をローカル位置番号からデータベースDB中のレコード番号に換算することにより新しいレコードの挿入を行う。
【0070】
例えば、図11で例示するグループ7は、データベースDB中での行番では「800」から「7」件を占めているが、図5で指定した挿入位置は選択されたグループ内でのローカル位置番号として得られ、挿入位置直前の「鈴木三郎」が「3」行目、挿入位置直後の「佐野太郎」が「4」行目である。このため、ローカル位置番号で「4」行目直前という挿入位置は、選択解除した状態でのデータベースDB中の行番に換算すれば、選択画面上で取得した行番「4」と、直前のグループ6の最後尾を示した行番「799」を足した値、すなわち799+4=「803」行目の直前、となる。この関係を図12の概念図に示す。
【0071】
すなわち、本実施形態では、レコード挿入位置の指定と取扱いについても従来技術と大きく異なる。すなわち、データベースシステムによっては、所望の条件のレコードを画面表示するためには該当レコードを所定の選択状態にする必要があり、選択状態のレコードはデータベース中のレコード番号すなわち行番とは異なる所定のローカル位置番号で特定され、その最大値は画面表示中の件数と同じ数字となる。この種のシステムでは、行挿入すなわちレコード挿入はデータベース自体に対するものなので、選択状態では実行できない。
【0072】
このような場合、従来では、各レコードにソート用の項目値として行番と同じ値を持たせ、画面表示のための選択状態で数えた位置とその直前の行番号を足して2で割った値をそのソート用の項目値に代入した行を、表の最後に追加し、表全体をソートし並べ替えることで、追加した行を指定位置に移動させていたが、その所要時間はレコード数やデータ量に比例して増大し負担となっていた。
【0073】
これに対し本実施形態は、そのようなソートを使わず、該当する位置に直接挿入するが、挿入はデータベース自体に対して直接行う処理なので、その条件として、選択状態はいったん解除する。このように選択を解除するとカーソルは初期化されて表のトップ位置に戻り、その状態から入力準備に入るので、選択中に挿入位置を指定したローカル位置番号では、レコード挿入位置を特定することはできない。そこで、本実施形態では、トップから数えた行番を求めるために、ローカル位置番号をデータベース中のレコード番号に換算している。
【0074】
このような本実施形態では、選択状態のままでは行挿入等のレコード挿入が行えない場合も、挿入位置の指定後に選択状態を解除し、挿入位置指定時の番号をデータベース中のレコード番号に換算してレコード挿入を行える利点があり、幅広い多様なシステムを適用対象とすることができる。特に、従来では選択状態のまま入力すれば表の最後への追加となり再ソートをはじめとする煩雑な処理を要したところそれが不要となる。
【0075】
〔2−7.新規レコードの行挿入処理〕
上記のように指定した挿入位置へカーソルを移動させ、新しいレコードの行を挿入(図2のステップ4)した結果を図13の概念図に示す。この例は、昭和32年5月31日生まれの「新規太郎」の社員データのレコードが挿入されたケースで、その結果、挿入位置以降の既存データが一行ずつ下方にずれ、各行番が変化する。例えば、「佐野太郎」の行番が「803」から「804」に増え、以下同様に、「吉岡次郎」までの行番がインクリメント(1増加)する。この結果、当然、各グループが始まる行番も変化する。このような影響が及ぶのは、挿入したグループより後の各グループであり、すなわちグループ8の始まる行番が「807」だったものが「808」に増え、グループ9も同様である。
【0076】
このような行挿入処理の手順を図14のフローチャートに示す。すなわち、図5の状態で挿入位置として選択されたローカル位置番号であるカレントレコードの行番を変数hカレント行番に保存した後(ステップ41)、選択状態を解除し(ステップ42)、現在対象としているグループのh行番−1をh前グループ最後尾とし(ステップ43)、hカレント行番の内容をそれに加えることでデータベースDB中のレコード番号に換算された挿入位置を得て、それをh新入力位置とする(ステップ44)。
【0077】
そこへカーソルを移動し(ステップ45)、行挿入をデータベースDBへ反映させる(ステップ46)。続いて、今回挿入したレコード件数を示すh当件数をインクリメントし(ステップ47)、グループの冒頭から(ステップ48,51)、追加後におけるグループの新たな件数分を(ステップ52)選択して画面表示し(ステップ53)、カーソルは挿入位置の行に置く(ステップ54)。この状態が行挿入後に表示される入力画面であり、図15に示す。
【0078】
そして、その行について必要な他の項目の入力を終え(図14のステップ611)、次行にさらにレコード入力を行う場合は(ステップ613)、hカレント行番を増やして再度ステップ42からの処理を繰り返すが、次行にレコード入力を行わず終了する場合は(ステップ613)、図10の結合子2すなわちステップ30へ戻る。また、レコード入力の中断が指示されれば(ステップ612)、入力したデータの削除(ステップ62)や件数を減らして戻す処理(ステップ64)のうえ、図10の結合子2すなわちステップ30へ戻る。
【0079】
〔2−8.見出し表の更新〕
上記のような行挿入を行った場合は、見出し表H0に格納された範囲データである行番と件数の更新を行う(図2のステップ5)。上記の例ではグループ7へのレコード挿入(図13)に基いて、更新部3は図16に矢印で示すように、グループ7の件数と、グループ8と9の開始行番とを、それぞれ1ずつ増大させる更新を見出し表H0に対して行うことで次回の利用に備える。なお、図16に示す「当件数」が今回追加挿入したレコード件数である。
【0080】
このような行番と件数の更新の処理手順を図17のフローチャートに示す。すなわち、この手順では、見出し表H0を開き(ステップ81)、カーソルを今回レコードを追加入力したグループの範囲データに移動させる(ステップ82)。なお、この際、見出し表H0ではグループ番号が行番と一致しているので、変数hグ番号の値を使ってカーソルを移動すればよい(ステップ82)。そして、そのグループの範囲データのうち、[件数]の値を、今回入力した当件数を加えた値で書き換える(ステップ83)。
【0081】
そして、終端行まで(ステップ841)カーソルを一行ずつ移動しながら(ステップ84)、各行の[行番]の値を(ステップ85)、それに当件数を加えた値で(ステップ86)書き換え(ステップ87)、終端行に至ると(ステップ841)見出し表H0を新しいデータで書き換える(ステップ88)。
【0082】
また、図18のフローチャートは、配列を用いる場合に、見出し表H0の行番と件数の更新を行なう処理手順を示すもので、この場合は、配列変数h行番[]の更新のうえ(ステップ91)、見出し表H0を開く(ステップ92)。そして、カーソルをトップから(ステップ93)一行ずつ移動させながら(ステップ97)変数hグ番号を0から(ステップ94)インクリメントし(ステップ95)見出し表H0のその行の[行番]の項目値を配列変数h行番[hグ番号]に置き換えてゆく(ステップ96)。そして、終端行に至ると(ステップ971)見出し表H0を保存終了する(ステップ98)。
【0083】
〔2−9.その他〕
なお、図10で分岐先の一つとして示した「他のグループ編集」は、範囲データである行番と件数を配列変数に保持することでいちいちデータベースDBへアクセスせずに複数のグループへのレコード追加を連続して行う場合に、レコード追加対象グループを新しく選択する処理で、その処理手順を図19のフローチャートに示す。
【0084】
この手順では、それまでのレコード追加に基いて配列変数h行番[]を更新のうえ(ステップ61)、次のグループの番号の入力を受け付け、hグ現番号へ代入する(ステップ62)。また、配列変数のh行番[]の更新は、図20のフローチャートに示すように、最大グループ番号を表すh終グ番号まで(ステップ711)hグ現番号をインクリメントしながら(ステップ71)、h行番[hグ現番号]を当件数分だけ増やす処理を繰り返す(ステップ72)。
【0085】
〔3.効果〕
上記のような本実施形態では、グループごとの行番号などレコードの範囲を範囲データとして保持及び更新するので、次のレコード追加時に、グループや挿入位置を画面表示してユーザに選択させるなどの処理を、範囲データを利用して迅速に行うことができ、処理が大幅に効率化される。
【0086】
これらの態様では、範囲データについても、目的の表と同じデータベースの別の表に保持するので、同じデータベースシステムの機能で容易に扱える利点がある。特に、グループ分けのキー項目について、表中での繰り返しが回避できるので、データのいわゆる正規性が維持され、キー項目を検索したり表示等する処理が大幅に効率化される。
【0087】
〔4.他の実施形態〕
本発明は、上記実施形態に限定されるものではなく、次に例示するような他の実施形態も含むものである。例えば、上記実施形態では、レコードを追加する際、該当するグループ又はグループ中の挿入位置の少なくとも一方を特定する処理として、グループと挿入位置をユーザに手作業で指定させたが、ユーザによる追加レコードの入力値からこれらを自動判断するようにしてもよい。また、上記実施形態は、行挿入機能のあるリレーショナルデータベースシステムを前提に説明したが、行挿入機能の無いものや、表計算ソフトウェア、ワードプロセッサの計算機能など、他の種類のプログラムやシステムに本発明を適用してもよい。
【0088】
また、最初や最後のレコード番号や件数、キー項目などの範囲データは、所定の変数に保持してもよい。このようにすれば、データベースシステムが扱う表の数を減らし、システムの単純化や負担軽減が可能となる利点がある。
【0089】
【発明の効果】
以上のように、本発明によれば、データベース中の各グループの範囲を記録しておくことで、効率良くデータ挿入を行うデータベースシステム、データ処理方法及びデータベースプログラムを提供することができる。
【図面の簡単な説明】
【図1】本発明の実施形態の構成を示す機能ブロック図である。
【図2】本発明の実施形態における処理手順の概略を示すフローチャートである。
【図3】本発明の実施形態における明細表のデータ構造を例示する概念図である。
【図4】本発明の実施形態における見出し表のデータ構造を例示する概念図である。
【図5】本発明の実施形態における表示画面を例示する図である。
【図6】本発明の実施形態における行挿入を説明する概念図である。
【図7】本発明の実施形態における行番と件数の取り出しの処理手順を示すフローチャートである。
【図8】本発明の実施形態におけるグループの選択画面を示す図である。
【図9】本発明の実施形態において配列を用いる場合に、行番と件数の取り出しの処理手順を示すフローチャートである。
【図10】本発明の実施形態におけるレコードの呼出しの処理手順を示すフローチャートである。
【図11】本発明の実施形態におけるデータベース中のレコード番号である行番と、挿入位置指定におけるローカル位置番号である行番との関係を示す概念図である。
【図12】本発明の実施形態における選択状態における挿入位置指定と選択解除を示す概念図である。
【図13】本発明の実施形態における行挿入を示す概念図である。
【図14】本発明の実施形態における行挿入の処理手順を示すフローチャートである。
【図15】本発明の実施形態における行挿入後の表示画面を例示する図である。
【図16】本発明の実施形態における行挿入後の行番及び件数の更新を示す概念図である。
【図17】本発明の実施形態における行番と件数の更新の処理手順を示すフローチャートである。
【図18】本発明の実施形態において、配列を用いる場合における行番と件数の更新の処理手順を示すフローチャートである。
【図19】本発明の実施形態における他のグループ編集の処理手順を示すフローチャートである。
【図20】本発明の実施形態における配列変数更新の処理手順を示すフローチャートである。
【符号の説明】
DB…データベース
H0…見出し表
H1…明細表
M…検索等管理部
2…追加部
3…更新部
4…表示部
5…操作部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a database system, a data processing method, and a database program for efficiently inserting data by recording the range of each group in a database.
[0002]
[Prior art]
2. Description of the Related Art In recent years, relational databases have become widespread in information processing fields such as business (for example, see Patent Document 1). The relational database is, for example, a database in which several information items such as names and dates of birth are arranged in units of "tables" for the number of records, and includes a case where the information is realized by so-called spreadsheet software. The "table" in such a relational database can be re-sorted by a desired key item when necessary, but items frequently used for processing are determined to some extent depending on the purpose of use. In addition, the time required for sorting also increases according to the number of records. Therefore, it is desirable that records corresponding to the rows in the table are arranged in the order of groups having common values of necessary items according to the purpose of use.
[0003]
[Patent Document 1]
JP 2001-331353A
[0004]
[Problems to be solved by the invention]
When considering the addition of a new record based on this premise, there is a problem that a large amount of data takes a long time and lacks promptness. In other words, in the ordinary general record addition process, the addition position is at the end of the table, so it is necessary to move the added record to the group to which it originally belongs, that is, the record group with the same item value. There is a problem that the entire table needs to be re-sorted with the key items, and it takes a long time to sort according to the amount of data. Also, in this case, to avoid the need for the same sort the next time you use, write to another table in the same sorted order, delete the original table, read the new one, and rewrite the table etc. Work was also required and complicated.
[0005]
As a method that does not use the sort processing as described above, there is a method in which, once a state of neat arrangement in each group is secured, a record is added only at an appropriate insertion position. In other words, based on the item values of the new data to be added, the input user must manually search for the group to which the table belongs and the insertion position from the table, and insert it between records, while checking with the cursor operation in advance. This keeps the records neatly arranged. However, this kind of manual operation, such as searching with the naked eye while scrolling the cursor, is not only limited in speed and accuracy, but also takes a long time as the number of data items increases, and there is a problem that the insertion position may be mistaken. there were.
[0006]
On the other hand, there is a method to search for the appropriate insertion position by computer processing.However, to find a record that matches the value of the item to be added from the table, "search" or " The process of "selection" will be used. In general, the former "search" process is a process for determining whether or not a condition matches one condition at a time from the first record. Therefore, if the matching record is below the table and the number of records is large, it takes time. There was a problem.
[0007]
The latter “selection” process is a process in which a group to be selected is designated in advance and a group of records corresponding to the group is called on the screen. I will register. However, "selection" is faster if it is performed on data that has been sorted in advance, and the sorting process is eventually required before selection, which also has a problem of lack of speed.
[0008]
Even if the insertion position is specified from the record displayed in the selected state, the position is in the selected group or on the screen and is different from the position in the database table. Some systems cannot. In that case, if it becomes a stage to add by record insertion, the selection state must be canceled, and the trouble of confirming the insertion position in the selection state in the database twice is also a problem.
[0009]
The present invention has been proposed in order to solve the above-mentioned problems of the conventional technology. The purpose of the present invention is to record the range of each group in the database so that a database can be efficiently inserted. A system, a data processing method, and a database program are provided.
[0010]
[Means for Solving the Problems]
In order to achieve the above object, the invention according to claim 1 is a database system that stores data of one or more items in a table of a database for each record, wherein the values of predetermined items are permuted for each group having a common value. For records, holding means for holding range data representing the range of records for each group, when adding a new record to the database, processing to identify at least one of the corresponding group or the insertion position in the group, It is characterized by comprising additional means for performing based on the range data, and updating means for updating the range data based on the addition.
[0011]
According to a ninth aspect of the present invention, there is provided a data processing method for storing data of one or more items in a table of a database for each record in a data processing method. For the records permuted for each common group, a holding process for holding range data representing the range of records for each group, and when adding a new record to the database, the corresponding group or the insertion position in the group A computer performs at least one of a process of specifying the range data based on the range data and an update process of updating the range data based on the addition.
[0012]
According to a seventeenth aspect of the present invention, the invention of the first and ninth aspects is grasped from the viewpoint of a computer program. By controlling the computer, data of one or more items is stored in a table of a database for each record. In the database program, the program causes the computer to retain range data representing a range of records for each group, for the records arranged in groups of which the values of predetermined items are common, and store a new record in the database. At the time of addition, a process for specifying at least one of a corresponding group or an insertion position in the group is performed based on the range data, and the range data is updated based on the addition.
[0013]
In these modes, the range of records such as the line number for each group is held and updated as range data. Therefore, when the next record is added, processing such as displaying the group and the insertion position on the screen and allowing the user to select the range data is performed. , And the processing can be made more efficient.
[0014]
According to a second aspect of the present invention, in the database system according to the first aspect, the range data includes the number of records of each group.
[0015]
According to a tenth aspect of the present invention, the invention of the second aspect is grasped from the viewpoint of a method. In the data processing method according to the ninth aspect, the range data includes the number of records of each group.
[0016]
These embodiments have an advantage that the number of records in each group can be obtained directly from the range data. For a desired group, the first start record number can be easily obtained by adding 1 to the number of records up to immediately before, and the last last record number can be easily obtained by multiplying the number of records up to that group. Can be identified.
[0017]
The invention according to claim 3 is the database system according to claim 1 or 2, wherein the range data includes a start record number of each group.
[0018]
According to an eleventh aspect of the present invention, the invention of the third aspect is grasped from the viewpoint of a method. In the data processing method according to the ninth or tenth aspect, the range data includes a start record number of each group. And
[0019]
In these embodiments, in particular, there is an advantage that the first start record number of each group is obtained directly from the range data. For the desired group, the last and last record number can be easily obtained by subtracting 1 from the start record number of the immediately succeeding group, and the number of records can also be calculated from the start record number of the immediately succeeding group. It can be easily identified by subtracting it.
[0020]
According to a fourth aspect of the present invention, in the database system according to any one of the first to third aspects, the range data includes a last record number of each group.
[0021]
According to a twelfth aspect of the invention, the invention of the fourth aspect is grasped from the viewpoint of a method. In the data processing method according to any one of the ninth to eleventh aspects, the range data includes a last record number of each group. It is characterized by including.
[0022]
These embodiments have the advantage that the last record number at the end of each group can be obtained directly from the range data. For a desired group, the start record number can be easily obtained by adding 1 to the last record number of the immediately preceding group, and the number of records can be easily obtained by subtracting the last record number of the immediately preceding group from the last record number of the corresponding group. Can be specified.
[0023]
According to a fifth aspect of the present invention, in the database system according to any one of the first to fourth aspects, the adding unit retrieves the range data from the holding unit, and displays each group on a screen based on the range data. Accepting selection of a desired group, displaying each record of the selected group on the screen and accepting designation of the insertion position of the new record, accepting input of data of each item for the new record, and The addition is performed by inserting the data into the insertion position, and the updating unit updates the range data based on the addition.
[0024]
According to a thirteenth aspect of the present invention, the data processing method according to any one of the ninth to twelfth aspects is obtained by capturing the invention of the fifth aspect in terms of a method. In the adding process, based on the range data, each group is displayed on the screen, a desired group is selected, each record of the selected group is displayed on the screen, and the insertion position of the new record is designated. Accepting and accepting input of data of each item for the new record, adding by inserting the data at the specified insertion position, and updating the range data based on the addition. Characterized by
[0025]
The invention of claim 18 captures the invention of claims 5 and 13 from the viewpoint of a computer program. In the database program according to claim 17, when the record is added, the program is stored in the computer. Displaying each group on the screen based on the data and accepting selection of a desired group, displaying each record of the selected group on the screen and accepting designation of the insertion position of the new record, In addition, input of data of each item is accepted, insertion is performed by inserting the data at the specified insertion position, and the range data is updated based on the addition.
[0026]
In these aspects, there is an advantage that a series of processes from display and selection of a group, display of records in the group and designation of an insertion position, actual insertion and update of the range data can be smoothly performed by utilizing the range data. In this case, adding records is made much more efficient.
[0027]
According to a sixth aspect of the present invention, in the database system according to the fifth aspect, the adding means specifies each record of the selected group by a predetermined local position number different from a record number in the database. In the selection state, the display and the insertion position are designated as targets, and when the insertion position is specified, the selection state is released and the specified insertion position is changed from the local position number to the record number in the database. It is characterized in that a new record is inserted by conversion.
[0028]
According to a fourteenth aspect of the present invention, in the data processing method according to the thirteenth aspect, in the data processing method according to the thirteenth aspect, the additional processing stores each record of the selected group in the database. In a predetermined selection state specified by a predetermined local position number different from the record number, the display and the insertion position are designated as targets, and when the insertion position is specified, the selection state is released and the specification is released. A new record is inserted by converting the inserted insertion position from the local position number to a record number in the database.
[0029]
The invention of claim 19 captures the invention of claims 6 and 14 from the viewpoint of a computer program. In the database program according to claim 18, upon the addition, the program is selected by the computer. When each record of the group is designated as the display and insertion position in a predetermined selection state specified by a predetermined local position number different from the record number in the database, and the insertion position is specified The selected state is canceled, and a new record is inserted by converting the designated insertion position from a local position number to a record number in the database.
[0030]
In these modes, even when a record insertion such as row insertion cannot be performed in the selected state, the selection state is released after the insertion position is specified, and the number at the time of specifying the insertion position is converted into the record number in the database to record the data. It has the advantage of insertion and can be applied to a wide variety of systems. In particular, in the past, if the input was made in the selected state, it would be added to the end of the table, and complicated processing such as re-sorting would be unnecessary.
[0031]
According to a seventh aspect of the present invention, in the database system according to any one of the first to sixth aspects, the holding means holds the range data in a predetermined variable.
[0032]
According to a fifteenth aspect of the present invention, the invention of the seventh aspect is grasped from the viewpoint of a method. In the data processing method according to any one of the ninth to fourteenth aspects, the holding processing includes the step of: It is characterized in that it is stored in a variable.
[0033]
In these embodiments, since the range data such as the first and last record numbers and the number of records, and key items which are the criteria for grouping are stored in variables, the number of tables handled by the database system is reduced, and the system is simplified. There is an advantage that the burden can be reduced.
[0034]
The invention according to claim 8 is the database system according to any one of claims 1 to 7, wherein the holding unit holds the range data in a second table different from the table.
[0035]
According to a sixteenth aspect of the present invention, in the data processing method according to any one of the ninth to fifteenth aspects, the holding processing includes storing the range data in the table. It is stored in a second table different from the second table.
[0036]
According to a twentieth aspect of the invention, the inventions of the eighth and sixteenth aspects are grasped from the viewpoint of a computer program. In the database program according to any one of the seventeenth to nineteenth aspects, the program is stored in the computer. The data is stored in a second table different from the table.
[0037]
In these embodiments, the range data is also stored in another table of the same database as the target table, so that there is an advantage that the range data can be easily handled by the same database system function. In particular, since the repetition of the key items of the grouping in the table can be avoided, the so-called normality of the data is maintained, and the processing of searching for and displaying the key items is greatly improved.
[0038]
BEST MODE FOR CARRYING OUT THE INVENTION
Next, embodiments of the present invention (hereinafter, referred to as “embodiments”) will be specifically described with reference to the drawings. The database system according to the present embodiment (hereinafter referred to as “the present system”) can be realized by controlling a computer provided with necessary peripheral devices with a program, and in this case, the manner of realizing the hardware and the program can be variously changed. is there. In addition, the embodiment can be understood as a method, a computer program, and a computer-readable recording medium recording such a program, in addition to the device. As described above, since various modes of realization of the present embodiment are conceivable, in the following description, virtual circuit blocks that realize the functions of the present invention and the present embodiment will be used.
[0039]
[1. Constitution〕
[1-1. overall structure〕
The present system is a database system that stores data of one or more items in a database table for each record, and as a function of the above-described program, as shown in the functional block diagram of FIG. , A heading table H0 and a specification table H1.
[0040]
First, the detail table H1 is a database table that stores data of one or more items for each record. The heading table H0 is a range representing the range of records for each group, with respect to the records stored in the detail table H1 and permuted for each group having a common value of a predetermined key item, which is an item serving as a reference for grouping. This is a holding means for holding data, and is a second table different from the detailed table H1.
[0041]
First, in the search management section M using an RDBMS (relational database management system) or the like, the addition section 2 and the update section 3 are realized by the operation of the program. The adding unit 2 is an adding unit that, when adding a new record to the database, performs a process of specifying at least one of a corresponding group or an insertion position in the group based on the range data. The updating unit 3 is an updating unit that updates the range data based on the addition.
[0042]
Further, the system includes a display unit 4 such as a liquid crystal display panel as an input / output unit, and an operation unit 5 such as a mouse and a keyboard. The display unit 4 is used for outputting information such as groups, records, and data, and the operation unit 5 is used for inputting operations and instructions, selecting records, specifying insertion positions, and inputting data.
[0043]
[1-2. How to represent range data)
In the present embodiment, the range data can be expressed in any manner, but typically, together with the value of the key item, ie, the key item value, which is the basis for dividing each group, the number of records corresponding to the key item value, It is conceivable that one or more of the record number and the last record number are included. For example, in an embodiment using the number of records, there is an advantage that the number of records of each group can be obtained directly from the range data. For a desired group, the first start record number can be easily obtained by adding 1 to the number of records up to immediately before, and the last last record number can be easily obtained by multiplying the number of records up to that group. Can be identified.
[0044]
In addition, the mode using the start record number has an advantage that the first start record number of each group can be obtained directly from the range data. For the desired group, the last and last record number can be easily obtained by subtracting 1 from the start record number of the immediately succeeding group, and the number of records can also be calculated from the start record number of the immediately succeeding group. It can be easily identified by subtracting it.
[0045]
In addition, the mode using the last record number has an advantage that the last record number at the end of each group can be obtained directly from the range data. For a desired group, the start record number can be easily obtained by adding 1 to the last record number of the immediately preceding group, and the number of records can be easily obtained by subtracting the last record number of the immediately preceding group from the last record number of the corresponding group. Can be specified.
[0046]
In the present embodiment, record numbers are also referred to as “line numbers” and “line numbers”, and the range data for each group is a start record number and the number of records.
[0047]
[2. Action)
[2-1. Outline of action)
In the present embodiment configured as described above, when the adding unit 2 adds a new record to the database DB, the process of specifying the corresponding group and the insertion position in the group is stored in the index table H0. This is performed based on the range data. Then, the updating unit 3 updates the range data of the index table H0 based on such addition.
[0048]
Specifically, as shown in the flowchart of FIG.
(1) The range data, that is, the row number and the number of records for each group are taken out from the index table H0, and each group is displayed on the screen based on the range data, and a desired group is selected (step 1).
(2) Calling of each record of the selected group, that is, screen display is performed (Step 2), and designation of the insertion position of the new record is received (Step 3),
(3) With respect to the new record, input of data of each item is accepted, and addition is performed by performing insertion processing at the specified insertion position (step 4), and (4) the updating unit 3 performs such addition. Based on the addition, the row number and the number of cases, which are the range data of each affected group, are updated (step 5).
[0049]
As described above, in the present embodiment, by utilizing the range data, a series of processes from display and selection of a group, display of records in the group and designation of an insertion position, actual insertion and update of the range data smoothly proceed. And the efficiency of adding records is greatly improved.
[0050]
[2-2. Simple example)
Here, a simple example of a process utilizing the range data will be described. For example, when the number of records in each group is counted for each group, the line number at which each group starts can be found. For example, when four records are arranged in the a group, three records are arranged in the b group, and two records are arranged in the c group in order from the top, the line number where the c group starts is the sum of the numbers of the previous cases of the groups a and b. "1" is added to "8".
[0051]
In this example, the calculation is easy because the total number of records before the c group is only seven, but the calculation time increases as the number of groups or records increases. Therefore, in this embodiment, each time a record is added, , The number of records and the row number are updated to the latest values, and the results are recorded in the index table H0, thereby improving the efficiency of the processing. In this way, when a record in the same group as the added portion is called on the screen, the line number range of the group to be called on the screen can be instantaneously specified only by referring to the recorded information.
[0052]
[2-3. Concrete example〕
Here, an example of data used in the following description is shown. This example is an employee information system that manages personal information such as employee names and birth dates in groups for each section. Specifically, the data items handled for each employee are “district”, “department”, “section”, “name”, “date of birth”, “gender”, “title”, and “hometown”. Of these, the personal unique information after the name is stored in the detail table H1 as a record for each person in units of each item as shown in FIG.
[0053]
In these records, those having predetermined key item values are grouped into the same group, but the key items common to each group are “district”, “department” obtained by removing the personal information from the above data items. , “Section”. Then, in the heading table H0, a group number (“group number” in the figure) as an item, respective key item values “district”, “part”, “section” corresponding to the group number, and belonging to the corresponding group The "line number" of the record, that is, the start record number and the "number of records" are stored as range data for each record as shown in FIG.
[0054]
FIG. 5 shows an example of a screen display of such information. That is, the key item value of the group to be displayed is displayed at the top of the screen, and this part is called a “heading part”. The display content of this part is the output condition of the record displayed below it. Then, the part that displays the records of the group below the heading part is called a “specification part”. Regarding the range of records to be displayed in the detail section, the first position is directly grasped by “line number” based on the range data of the group stored in the header table H0, and the end position is represented by “number” in the line number. Additionally calculated.
[0055]
Then, when new data is added at an arbitrary insertion position, that is, between lines, the group and subsequent line numbers and the number of records change, and the updated value is reflected in the range data in the index table H0, and the next group It is used to display each screen. The outline of adding a record using such range data is shown in the conceptual diagram of FIG. 6, and the processing procedure will be described below with reference to the steps shown in FIG.
[0056]
[2-4. Extract line number and number and select group)
That is, in step 1 of FIG. 2, first, as shown in the flowchart of FIG. 7, a heading table H0 in which data for a heading portion is stored is opened, and in addition to the "group number" of the items, a key item value is displayed. A certain "district", "part", or "section" is extracted by projection, and a list of key item values for each group is output to a screen, that is, displayed on the screen (step 11). By projection, the screen (FIG. 8) displays “group number”, “district”, “part”, and “section”, but does not display “line number” and “number of cases”.
[0057]
When the user specifies a group to which the data of the record to be added belongs from the group candidate list on the screen displayed in this way (step 12), each key item value of the specified group and “number of records” And "line number", which is the start record number of the group, are copied to the corresponding variables (steps 13 and 14). In the present embodiment, variables are appropriately represented by names or abbreviations starting with “h”.
[0058]
The example in FIG. 8 is a screen for specifying the assignment destination in which a plurality of groups that can be selected in this manner are displayed on the screen. The row indicated by the arrow on this screen, that is, the group number “7” in the seventh row, the district “ Move the cursor to the row of "Yokohama branch office", section "General affairs department", section "2" and perform a predetermined operation such as input of the execution key. From the two columns on the right side not displayed on the screen, it corresponds to the specified group Only one pair of the row number “800” and the number of cases “7” is substituted for a predetermined variable, for example, the h-th row number and the h-number.
[0059]
Further, once the contents of the index table H0 are called into an array variable on the memory, records can be added to a plurality of groups without accessing the index table H0, and the subsequent processing can be made more efficient. FIG. 9 shows a processing procedure for extracting the line number and the number of cases and for selecting a group.
[0060]
In this procedure, the variable hg number storing the group number is incremented from 0 (step 103) as a loop control variable from the top of (step 101) to the last row (steps 102 and 103) of the index table H0 (step 107). While (step 104), the [position] in the index table H0 is substituted into the array variable h line number [h number] with the h number as a subscript (step 105), and the cursor is moved line by line (step 106). .
[0061]
When the cursor has passed the last line (step 107), the last h number is substituted for the last h number, which is the last record number (step 108), and the projection and output (step 109) are performed. After the selection (step 110), the selected [group number] is set as a variable h group current number, and the table is closed (step 112).
[0062]
[2-5. Call record)
FIG. 10 is a flow chart of FIG. 10 showing the procedure of the process (step 2 in FIG. 2) of calling a target record from the group number selected as described above and the information on the row number and the number of records taken out and recorded in a predetermined variable corresponding to the group number Shown in Note that the broken line in the flowchart relates to the case where array variables are used as shown in FIG. 9, and the same applies to the following flowcharts.
[0063]
In the procedure of FIG. 10, first, the detail table H1 is opened (step 21), the position where the designated group starts is grasped by the line number, and the cursor is moved to the corresponding record (step 22). As a result, it is not necessary to search for records from the top of the table to the row immediately before the record, so the record of the selected group can be called on the screen regardless of the number or capacity of the input data. It becomes.
[0064]
For example, in the example shown in the conceptual diagram of FIG. 11, since the line number which is the start record number of the specified group 7 is the 800th line, the search processing for 799 lines can be omitted. Also, since records are continuously arranged in ascending or descending order of key items up to the last record number of the group, the last record number that should be displayed as belonging to the group Then, the range of the group is specified by assuming that the "number of records" in the group has been added up to that point, the range is selected, and the screen can be instantaneously displayed (step 23). The selection state in the present embodiment is referred to as “line number selection”.
[0065]
As a result, in the example of FIG. 11, it is not necessary to perform all the searches from the line number 807 after the selected group 7 to the 900th line where the table ends. The record pointed to by the pointer, that is, the cursor at each point in time is called a “current record”.
[0066]
In this way, the record is displayed on the screen, the variable value of the heading portion, that is, the item value is displayed at the top of the screen (step 24), and a key input for selecting an operation is received (step 30). In the example of FIG. 10, the process branches to some processes in accordance with some variables for state detection, that is, h section, h section row, h section state, and state of the h section button (steps 31 to 35). Such a user interface can be freely designed. For example, depending on the program configuration, if the cursor is not pointing to any line or line at the time of pressing the insertion key, the current line is inserted. Please specify ". In the case where the range data of a plurality of groups has already been read into the array variables (FIG. 9), for example, by selecting “edit another group”, editing such as adding a record to another group can be subsequently performed.
[0067]
[2-6. Designation of insertion position)
However, the design of the user interface as described above is only an example and can be freely changed. What is important is that the user can specify a desired insertion position between records of the selected group (see FIG. 2). Step 3). For example, in the state of FIG. 5, the user specifies a desired record by moving the cursor up and down by key operation, and performs a predetermined operation such as pressing an insert key (step 31 in FIG. 10). The position between the records pointed to is set as the insertion position (step 32), and the process proceeds to the line insertion process (step 35).
[0068]
For example, the example of FIG. 5 is a state in which the second section of the General Affairs Department of the Yokohama branch office is selected as the assignment destination of the newly joined employee (FIG. 8), and the respective records are displayed on the screen. Are ordered in ascending date of birth. In this case, if the newly input record is related to the birth in 1957, the cursor is specified between the third and fourth lines as indicated by an arrow in FIG. 5, and the insertion position is specified by pressing the insert key. You.
[0069]
By the way, the designation of the display and the insertion position as described above by the adding unit 2 is performed in a selected state in which each record of the target group is selected. In this selected state, each record of the selected group is stored in the database DB. Is specified by a predetermined local position number different from the record number. For this reason, when the insertion position is specified, the adding unit 2 cancels such a selection state, and converts the specified insertion position from the local position number to the record number in the database DB, thereby obtaining a new record. Perform the insertion.
[0070]
For example, the group 7 illustrated in FIG. 11 occupies “800” to “7” in the row number in the database DB, but the insertion position specified in FIG. 5 is the local position in the selected group. "Saburo Suzuki" immediately before the insertion position is the third line, and "Taro Sano" immediately after the insertion position is the fourth line. Therefore, if the insertion position immediately before the "4" th line in the local position number is converted into the line number in the database DB in a state where the selection is released, the line number "4" acquired on the selection screen and the immediately preceding line number "4" This is a value obtained by adding the line number “799” indicating the tail of the group 6, that is, 799 + 4 = immediately before the “803” line. This relationship is shown in the conceptual diagram of FIG.
[0071]
That is, in the present embodiment, the specification and handling of the record insertion position is also greatly different from the related art. That is, depending on the database system, in order to display a record of a desired condition on the screen, it is necessary to set the corresponding record to a predetermined selection state, and the selected record is a predetermined number different from the record number, that is, the line number in the database. It is specified by the local position number, and its maximum value is the same number as the number of items displayed on the screen. In this type of system, row insertion, or record insertion, is to the database itself and cannot be performed in the selected state.
[0072]
In such a case, conventionally, each record has the same value as the line number as an item value for sorting, and the position counted in the selected state for screen display and the line number immediately before it are divided by two. A row in which the value was assigned to the sort field value was added to the end of the table, and the entire table was sorted and sorted, and the added row was moved to the specified position. And increased in proportion to the amount of data.
[0073]
On the other hand, in the present embodiment, such sorting is not used, and the data is directly inserted into the corresponding position. However, since the insertion is performed directly on the database itself, the selection state is temporarily canceled as a condition. When the selection is canceled in this way, the cursor is initialized and returns to the top position of the table, and input preparation is started from that state, so it is not possible to specify the record insertion position with the local position number that specified the insertion position during selection. Can not. Therefore, in this embodiment, the local position number is converted into a record number in the database in order to obtain the line number counted from the top.
[0074]
In this embodiment, even when a record cannot be inserted such as a row inserted in the selected state, the selected state is released after the insertion position is specified, and the number at the time of specifying the insertion position is converted into the record number in the database. This has the advantage that record insertion can be performed, and a wide variety of systems can be applied. In particular, in the past, if the input was made in the selected state, it would be added to the end of the table, and complicated processing such as re-sorting would be unnecessary.
[0075]
[2-7. New record row insertion processing)
The result of moving the cursor to the insertion position designated as described above and inserting a new record line (step 4 in FIG. 2) is shown in the conceptual diagram of FIG. In this example, a record of employee data of "Shintaro" born on May 31, 1957 is inserted. As a result, existing data after the insertion position shifts downward by one line, and each line number changes. . For example, the line number of “Taro Sano” increases from “803” to “804”, and similarly, the line number to “Jiro Yoshioka” is incremented (increased by 1). As a result, the line number at which each group starts naturally changes. Such an influence is exerted on each group after the inserted group, that is, the line number where the starting line of the group 8 is “807” is increased to “808”, and the same applies to the group 9.
[0076]
The procedure of such a row insertion process is shown in the flowchart of FIG. That is, after the line number of the current record which is the local position number selected as the insertion position in the state of FIG. 5 is stored in the variable h current line number (step 41), the selection state is released (step 42), and the current target The h-line number -1 of the group is set to the end of the group before h (step 43), and the contents of the h-current line number are added thereto to obtain the insertion position converted into the record number in the database DB. h The new input position is set (step 44).
[0077]
The cursor is moved there (step 45), and the line insertion is reflected in the database DB (step 46). Subsequently, the number of hits indicating the number of records inserted this time is incremented (step 47), and from the beginning of the group (steps 48 and 51), a new number of records of the group after addition (step 52) is selected and displayed. It is displayed (step 53), and the cursor is placed on the line at the insertion position (step 54). This state is the input screen displayed after the line is inserted, and is shown in FIG.
[0078]
When input of other necessary items for the line is completed (step 611 in FIG. 14), and when a record is to be input to the next line (step 613), the current line number is increased and the processing from step 42 is performed again. Is repeated, but if the processing is terminated without inputting a record to the next line (step 613), the flow returns to the connector 2 in FIG. 10, that is, step 30. Also, if the interruption of the record input is instructed (step 612), the input data is deleted (step 62), the number of records is reduced and returned (step 64), and then the process returns to the connector 2 in FIG. 10, that is, step 30. .
[0079]
[2-8. Update of heading table)
When the row insertion as described above is performed, the row number and the number of the range data stored in the index table H0 are updated (step 5 in FIG. 2). In the above example, based on the record insertion into the group 7 (FIG. 13), the updating unit 3 sets the number of the group 7 and the starting line numbers of the groups 8 and 9 to 1 as shown by arrows in FIG. By updating the index table H0 in increments of the index, the table is prepared for the next use. The “number of hits” shown in FIG. 16 is the number of records additionally inserted this time.
[0080]
FIG. 17 is a flowchart showing a procedure for updating the line number and the number of records. That is, in this procedure, the heading table H0 is opened (step 81), and the cursor is moved to the range data of the group to which the current record is additionally input (step 82). At this time, since the group number matches the line number in the index table H0, the cursor may be moved using the value of the variable hg number (step 82). Then, in the range data of the group, the value of [number of cases] is rewritten with the value obtained by adding the number of cases input this time (step 83).
[0081]
Then, while moving the cursor one line at a time to the last line (step 841) (step 84), the value of [line number] of each line is rewritten (step 86) with the value obtained by adding the number of hits (step 86) (step 86). 87), when the end line is reached (step 841), the index table H0 is rewritten with new data (step 88).
[0082]
The flowchart of FIG. 18 shows a processing procedure for updating the row number and the number of records in the index table H0 when an array is used. In this case, the array variable h is updated after the row number [] (step 91), the heading table H0 is opened (step 92). Then, while moving the cursor from the top (step 93) one line at a time (step 97), the variable h number is incremented from 0 (step 94) (step 95). Is replaced with an array variable h line number [hg number] (step 96). Then, when the end line is reached (step 971), the storage of the index table H0 is terminated (step 98).
[0083]
[2-9. Others)
Note that “other group editing” shown as one of the branch destinations in FIG. 10 is performed by storing the row number and the number of records, which are range data, in an array variable to access a plurality of groups without accessing the database DB each time. FIG. 19 is a flowchart showing the procedure for newly selecting a record addition target group when record addition is performed continuously.
[0084]
In this procedure, the array variable h row number [] is updated based on the record addition so far (step 61), and the input of the number of the next group is accepted and substituted into the current group number (step 62). As shown in the flowchart of FIG. 20, the h-line number [] of the array variable is updated while incrementing the h-g current number up to the h-end number (step 711) indicating the maximum group number (step 71). The process of increasing the h-th line number [h-g current number] by the number of cases is repeated (step 72).
[0085]
[3. effect〕
In the present embodiment as described above, the range of records such as the line number of each group is stored and updated as range data, so that when the next record is added, the group and the insertion position are displayed on the screen and the user can select the processing. Can be performed quickly by using the range data, and the processing is made much more efficient.
[0086]
In these embodiments, the range data is also stored in another table of the same database as the target table, so that there is an advantage that the range data can be easily handled by the same database system function. In particular, since the repetition of the key items of the grouping in the table can be avoided, the so-called normality of the data is maintained, and the processing of searching for and displaying the key items is greatly improved.
[0087]
[4. Other embodiments]
The present invention is not limited to the above embodiment, but includes other embodiments as exemplified below. For example, in the above embodiment, when adding a record, the user manually specifies the group and the insertion position as a process of specifying at least one of the corresponding group or the insertion position in the group. These may be automatically determined from the input value of. Although the above embodiment has been described on the premise that the relational database system has a row insertion function, the present invention can be applied to other types of programs and systems, such as those without a row insertion function, spreadsheet software, and the calculation function of a word processor. May be applied.
[0088]
Also, range data such as the first and last record numbers, the number of records, and key items may be stored in predetermined variables. In this way, there is an advantage that the number of tables handled by the database system can be reduced, and the system can be simplified and the load can be reduced.
[0089]
【The invention's effect】
As described above, according to the present invention, by recording the range of each group in the database, it is possible to provide a database system, a data processing method, and a database program for efficiently inserting data.
[Brief description of the drawings]
FIG. 1 is a functional block diagram showing a configuration of an embodiment of the present invention.
FIG. 2 is a flowchart illustrating an outline of a processing procedure in the embodiment of the present invention.
FIG. 3 is a conceptual diagram illustrating a data structure of a specification table according to the embodiment of the present invention.
FIG. 4 is a conceptual diagram illustrating a data structure of a heading table according to the embodiment of the present invention.
FIG. 5 is a diagram illustrating a display screen according to the embodiment of the present invention.
FIG. 6 is a conceptual diagram illustrating row insertion in the embodiment of the present invention.
FIG. 7 is a flowchart illustrating a processing procedure for extracting a row number and the number of records according to the embodiment of this invention.
FIG. 8 is a diagram showing a group selection screen according to the embodiment of the present invention.
FIG. 9 is a flowchart illustrating a processing procedure for extracting a row number and a number of records when an array is used in the embodiment of the present invention.
FIG. 10 is a flowchart showing a processing procedure for calling a record in the embodiment of the present invention.
FIG. 11 is a conceptual diagram showing a relationship between a line number which is a record number in a database and a line number which is a local position number in the insertion position specification according to the embodiment of the present invention.
FIG. 12 is a conceptual diagram illustrating insertion position designation and deselection in a selected state according to the embodiment of the present invention.
FIG. 13 is a conceptual diagram illustrating row insertion in the embodiment of the present invention.
FIG. 14 is a flowchart illustrating a procedure of a row insertion process in the embodiment of the present invention.
FIG. 15 is a diagram exemplifying a display screen after a row is inserted in the embodiment of the present invention.
FIG. 16 is a conceptual diagram illustrating updating of a row number and the number of rows after row insertion in the embodiment of the present invention.
FIG. 17 is a flowchart illustrating a processing procedure for updating the row number and the number of records according to the embodiment of this invention.
FIG. 18 is a flowchart illustrating a processing procedure for updating a row number and the number of records when an array is used in the embodiment of the present invention.
FIG. 19 is a flowchart showing another group editing processing procedure in the embodiment of the present invention.
FIG. 20 is a flowchart illustrating a processing procedure for updating an array variable in the embodiment of the present invention.
[Explanation of symbols]
DB… Database
H0 ... heading table
H1 ... Detailed table
M: Search and other management unit
2. Additional part
3. Update section
4 Display unit
5 Operation unit

Claims (20)

一以上の各項目のデータをレコードごとにデータベースの表に格納するデータベースシステムにおいて、
所定の項目の値が共通するグループごとに順列した前記レコードについて、各グループごとのレコードの範囲を表す範囲データを保持する保持手段と、
前記データベースに新たなレコードを追加する際、該当するグループ又はグループ中の挿入位置の少なくとも一方を特定する処理を、前記範囲データに基いて行う追加手段と、
前記追加に基いて前記範囲データを更新する更新手段と、
を備えたことを特徴とするデータベースシステム。
In a database system that stores data of one or more items in a database table for each record,
Holding means for holding range data indicating a range of records for each group, for the records in which the values of the predetermined items are permuted for each group having a common value;
When adding a new record to the database, processing to specify at least one of the corresponding group or the insertion position in the group, an additional unit performing based on the range data,
Updating means for updating the range data based on the addition;
A database system comprising:
前記範囲データは、各グループのレコード件数を含むことを特徴とする請求項1記載のデータベースシステム。The database system according to claim 1, wherein the range data includes the number of records of each group. 前記範囲データは、各グループの開始レコード番号を含むことを特徴とする請求項1又は2記載のデータベースシステム。3. The database system according to claim 1, wherein the range data includes a start record number of each group. 前記範囲データは、各グループの最終レコード番号を含むことを特徴とする請求項1から3のいずれかに記載のデータベースシステム。4. The database system according to claim 1, wherein the range data includes a last record number of each group. 前記追加手段は、
前記保持手段から前記範囲データを取り出し、
その範囲データに基いて各グループを画面表示するとともに所望のグループの選択を受け付け、
選択されたグループの各レコードを画面表示するとともに前記新たなレコードの挿入位置の指定を受け付け、
前記新たなレコードについて、各項目のデータの入力を受け付けるとともに、指定された前記挿入位置に挿入することにより追加を行い、
前記更新手段は、前記追加に基いて前記範囲データの更新を行うことを特徴とする請求項1から4のいずれかに記載のデータベースシステム。
The additional means,
Extracting the range data from the holding unit,
Based on the range data, each group is displayed on the screen and a desired group is selected,
Display each record of the selected group on the screen and accept the designation of the insertion position of the new record,
For the new record, while accepting the input of the data of each item, perform addition by inserting at the specified insertion position,
The database system according to any one of claims 1 to 4, wherein the updating unit updates the range data based on the addition.
前記追加手段は、
選択された前記グループの各レコードを、前記データベース中のレコード番号とは異なる所定のローカル位置番号で特定される所定の選択状態で、前記表示及び挿入位置の指定の対象とし、
前記挿入位置が指定されると、前記選択状態を解除するとともに、指定された挿入位置をローカル位置番号から前記データベース中のレコード番号に換算することにより新しいレコードの挿入を行うように構成されたことを特徴とする請求項5記載のデータベースシステム。
The additional means,
Each record of the selected group, in a predetermined selection state specified by a predetermined local position number different from the record number in the database, as the target of the display and insertion position designation,
When the insertion position is specified, the selection state is released, and the specified insertion position is configured to convert a local position number to a record number in the database to insert a new record. The database system according to claim 5, wherein:
前記保持手段は、前記範囲データを、所定の変数に保持することを特徴とする請求項1から6のいずれかに記載のデータベースシステム。7. The database system according to claim 1, wherein the holding unit holds the range data in a predetermined variable. 前記保持手段は、前記範囲データを、前記表とは異なる第2の表に保持することを特徴とする請求項1から7のいずれかに記載のデータベースシステム。8. The database system according to claim 1, wherein the holding unit holds the range data in a second table different from the table. 一以上の各項目のデータをレコードごとにデータベースの表に格納するデータ処理方法において、
所定の項目の値が共通するグループごとに順列した前記レコードについて、各グループごとのレコードの範囲を表す範囲データを保持する保持処理と、
前記データベースに新たなレコードを追加する際、該当するグループ又はグループ中の挿入位置の少なくとも一方を特定する処理を、前記範囲データに基いて行う追加処理と、
前記追加に基いて前記範囲データを更新する更新処理と、
をコンピュータが行うことを特徴とするデータ処理方法。
In a data processing method for storing data of one or more items in a database table for each record,
Holding processing for holding range data representing the range of records for each group, for the records permuted for each group having a common value of a predetermined item;
When adding a new record to the database, a process of specifying at least one of the corresponding group or the insertion position in the group, an additional process performed based on the range data,
Update processing for updating the range data based on the addition;
A data processing method wherein a computer performs the following.
前記範囲データは、各グループのレコード件数を含むことを特徴とする請求項9記載のデータ処理方法。The data processing method according to claim 9, wherein the range data includes the number of records of each group. 前記範囲データは、各グループの開始レコード番号を含むことを特徴とする請求項9又は10記載のデータ処理方法。11. The data processing method according to claim 9, wherein the range data includes a start record number of each group. 前記範囲データは、各グループの最終レコード番号を含むことを特徴とする請求項9から11のいずれかに記載のデータ処理方法。12. The data processing method according to claim 9, wherein the range data includes a last record number of each group. 前記追加処理は、
前記範囲データに基いて各グループを画面表示するとともに所望のグループの選択を受け付け、
選択されたグループの各レコードを画面表示するとともに前記新たなレコードの挿入位置の指定を受け付け、
前記新たなレコードについて、各項目のデータの入力を受け付けるとともに、指定された前記挿入位置に挿入することにより追加を行い、
前記更新処理は、前記追加に基いて前記範囲データの更新を行うことを特徴とする請求項9から12のいずれかに記載のデータ処理方法。
The additional processing includes:
Displaying each group on the screen based on the range data and accepting selection of a desired group,
Display each record of the selected group on the screen and accept the designation of the insertion position of the new record,
For the new record, while accepting the input of the data of each item, perform addition by inserting at the specified insertion position,
13. The data processing method according to claim 9, wherein the updating process updates the range data based on the addition.
前記追加処理は、
選択された前記グループの各レコードを、前記データベース中のレコード番号とは異なる所定のローカル位置番号で特定される所定の選択状態で、前記表示及び挿入位置の指定の対象とし、
前記挿入位置が指定されると、前記選択状態を解除するとともに、指定された挿入位置をローカル位置番号から前記データベース中のレコード番号に換算することにより新しいレコードの挿入を行うことを特徴とする請求項13記載のデータ処理方法。
The additional processing includes:
Each record of the selected group, in a predetermined selection state specified by a predetermined local position number different from the record number in the database, as the target of the display and insertion position designation,
When the insertion position is specified, the selected state is canceled, and a new record is inserted by converting the specified insertion position from a local position number to a record number in the database. Item 14. The data processing method according to Item 13.
前記保持処理は、前記範囲データを、所定の変数に保持することを特徴とする請求項9から14のいずれかに記載のデータ処理方法。15. The data processing method according to claim 9, wherein the holding processing holds the range data in a predetermined variable. 前記保持処理は、前記範囲データを、前記表とは異なる第2の表に保持することを特徴とする請求項9から15のいずれかに記載のデータ処理方法。16. The data processing method according to claim 9, wherein the holding processing holds the range data in a second table different from the table. コンピュータを制御することにより、一以上の各項目のデータをレコードごとにデータベースの表に格納させるデータベースプログラムにおいて、
そのプログラムは前記コンピュータに、
所定の項目の値が共通するグループごとに順列した前記レコードについて、各グループごとのレコードの範囲を表す範囲データを保持させ、
前記データベースに新たなレコードを追加する際、該当するグループ又はグループ中の挿入位置の少なくとも一方を特定する処理を、前記範囲データに基いて行わせ、
前記追加に基いて前記範囲データを更新させることを特徴とするデータベースプログラム。
In a database program that controls a computer to store data of one or more items in a database table for each record,
The program is stored on the computer
For the records in which the values of the predetermined items are permuted for each group having a common value, the range data indicating the range of the record for each group is held,
When adding a new record to the database, a process of identifying at least one of the corresponding group or the insertion position in the group, based on the range data,
A database program for updating the range data based on the addition.
前記レコードの追加にあたり、前記プログラムは前記コンピュータに、
前記範囲データに基いて各グループを画面表示させるとともに所望のグループの選択を受け付けさせ、
選択されたグループの各レコードを画面表示させるとともに前記新たなレコードの挿入位置の指定を受け付けさせ、
前記新たなレコードについて、各項目のデータの入力を受け付けさせるとともに、指定された前記挿入位置に挿入させることにより追加を行わせ、
前記追加に基いて前記範囲データの更新を行わせることを特徴とする請求項17記載のデータベースプログラム。
Upon adding the record, the program causes the computer to:
Displaying each group on the screen based on the range data and accepting selection of a desired group,
Display each record of the selected group on the screen and accept the designation of the insertion position of the new record,
Regarding the new record, the input of the data of each item is accepted, and the addition is performed by inserting the data at the specified insertion position,
The database program according to claim 17, wherein the range data is updated based on the addition.
前記追加にあたり、前記プログラムは前記コンピュータに、
選択された前記グループの各レコードを、前記データベース中のレコード番号とは異なる所定のローカル位置番号で特定される所定の選択状態で、前記表示及び挿入位置の指定の対象とさせ、
前記挿入位置が指定されると、前記選択状態を解除させるとともに、指定された挿入位置をローカル位置番号から前記データベース中のレコード番号に換算させることにより新しいレコードの挿入を行わせることを特徴とする請求項18記載のデータベースプログラム。
Upon the addition, the program is stored in the computer,
Each record of the selected group, in a predetermined selection state specified by a predetermined local position number different from the record number in the database, the target of the display and the insertion position specified,
When the insertion position is specified, the selection state is released, and the specified insertion position is converted from a local position number to a record number in the database to insert a new record. The database program according to claim 18.
前記プログラムは前記コンピュータに、前記範囲データを、前記表とは異なる第2の表に保持させることを特徴とする請求項17から19のいずれかに記載のデータベースプログラム。20. The database program according to claim 17, wherein the program causes the computer to hold the range data in a second table different from the table.
JP2003109365A 2003-04-14 2003-04-14 Database system, data processing method, and database program Pending JP2004318342A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003109365A JP2004318342A (en) 2003-04-14 2003-04-14 Database system, data processing method, and database program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003109365A JP2004318342A (en) 2003-04-14 2003-04-14 Database system, data processing method, and database program

Publications (1)

Publication Number Publication Date
JP2004318342A true JP2004318342A (en) 2004-11-11

Family

ID=33470547

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003109365A Pending JP2004318342A (en) 2003-04-14 2003-04-14 Database system, data processing method, and database program

Country Status (1)

Country Link
JP (1) JP2004318342A (en)

Similar Documents

Publication Publication Date Title
JPS6356726A (en) Method for converting knowledge base to data base
WO2005043409A1 (en) Table-formatted data connection method, connection device, and program
JP3552339B2 (en) Database system
JPH01290033A (en) Data retrieving system
JP2004318342A (en) Database system, data processing method, and database program
JPH0561758A (en) Information link device
US6088713A (en) Data processor for retrieving sentence data corresponding to an input character string and one or more selected text handling options
JPS59146339A (en) Information retrieving system
JPH06168270A (en) Character string retrieval system using index and preparing device for index
JPH11149481A (en) Information processor
JP3120443B2 (en) Command processing unit
JPH02210578A (en) Data retrieving and display system
JPH0916620A (en) Index retrieving system
JPH02190946A (en) Keyword control system
JPH06214849A (en) Data base system
JPH04233664A (en) Data base management system
JP2000148782A (en) Method and system for retrieval from relational data base and information recording medium where retrieving program for relational data base is recorded
JPH04559A (en) Data retrieving system
JPH07325740A (en) Information processor
JPH01248233A (en) Data base retrieving device
JPH0736916A (en) Image retrieval device
JPS62175824A (en) Document retrieving device
JPH0561911A (en) Data management device
JPH04138537A (en) Cabinet retrieving device for electronic filing device
JPH06290094A (en) Index file processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050502

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080722

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20081210