JPH01232428A - Data base enquiry processor - Google Patents
Data base enquiry processorInfo
- Publication number
- JPH01232428A JPH01232428A JP63058358A JP5835888A JPH01232428A JP H01232428 A JPH01232428 A JP H01232428A JP 63058358 A JP63058358 A JP 63058358A JP 5835888 A JP5835888 A JP 5835888A JP H01232428 A JPH01232428 A JP H01232428A
- Authority
- JP
- Japan
- Prior art keywords
- database
- definition information
- program
- object program
- data base
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000006243 chemical reaction Methods 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 12
- 238000000034 method Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 7
- 238000005457 optimization Methods 0.000 description 7
- 238000011161 development Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は、各種データベースを使用してその検索等を行
ない、所定のデータを得るデータベース問い合わせ処理
装置に関する。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a database inquiry processing device that uses various databases to perform searches and the like to obtain predetermined data.
(従来の技術)
情報処理装置において、何らかのプログラムを実行する
場合、そのプログラム中で特定のデータベースに格納さ
れたデータの一部を利用することがある。又、あるいは
、オペレータがあるデータベース中の特定のデータを、
端末装置からコマンドを入力することにより直接検索し
読み出すような場合がある。(Prior Art) When an information processing device executes a certain program, the program may use part of data stored in a specific database. Alternatively, the operator may select specific data in a database.
There are cases where a command is input from a terminal device to directly search and read.
この場合、データベース管理システム側では、検索用の
コマンド即ちデータベース問い合わせコマンドに文法上
の誤りが無いか点検するシンタックスチエツクと、その
コマンドに従ってデータベースを効率的に検索するオブ
ジェクトプログラムを生成するコンパイル作業が行なわ
れる。In this case, the database management system performs a syntax check to check whether there are any grammatical errors in the search command, that is, a database inquiry command, and compiles to generate an object program to efficiently search the database according to the command. It is done.
この手順を、リレーショナルデータベースを使用したデ
ータベース問い合わせ処理装置を例にとって説明する。This procedure will be explained using a database query processing device using a relational database as an example.
第2図には、先ず、そのリレーショナルデータベースの
内容の一例を示した。FIG. 2 first shows an example of the contents of the relational database.
リレーショナルデータベースというのは、多数の表形式
のデータを、いわゆる立体的に各種のキーを用いて検索
することができるデータベースで、例えばこの第2図に
示すように、従業員配置表という表データについてみる
と、氏名の列には従業員名が例えば五十音順に配列され
、従業員番号の列には各従業員に付されたコードが6桁
の数字で示され、所属の列にはアルファベットと3桁の
数字の組み合わせの所属コードが配列される、といった
内容のものである。A relational database is a database in which a large amount of tabular data can be searched three-dimensionally using various keys.For example, as shown in Figure 2, for tabular data such as an employee allocation table, In the name column, employee names are arranged in alphabetical order, for example, in the employee number column, the code assigned to each employee is shown as a 6-digit number, and in the affiliation column, the names are arranged in alphabetical order. and an affiliation code consisting of a combination of three digit numbers are arranged.
又、この表データは、氏名列を基準に五十音順にデータ
が配列されているので、氏名以外の列をキーにして検索
をする場合の便宜のために、従業員番号順索引1や所属
コード順索引2等が用意されている。In addition, this table data is arranged in alphabetical order based on the name column, so for convenience when searching using a column other than the name as a key, the employee number order index 1 or department Code order index 2 etc. are prepared.
このような形式のリレーショナルデータベースを検索す
る場合、例えば次のような命令をアプリケーションプロ
グラム中に含める。勿論、これをキーボードから直接人
力するようにしても差し支えない。When searching a relational database of this type, for example, the following instructions are included in the application program. Of course, you can also manually do this directly from the keyboard.
5ELECT 氏名 FROM 表名WHERE
氏名=゛沖 太部°。5ELECT Name FROM Table name WHERE
Name=゛Oki Abe°.
以上のデータベース問い合わせコマンドによって、第2
図に示した“沖 太部”という従業員め従業員番号等の
データが、アプリケーションプログラム中に取り込まれ
る。With the above database inquiry command, the second
Data such as the employee number of the employee "Okitabe" shown in the figure is incorporated into the application program.
第3図には、端末装置からこのようなデータベース問い
合わせコマンドが入力された場合の処理を実行する、デ
ータベース問い合わせ処理装置のブロック図を示した。FIG. 3 shows a block diagram of a database inquiry processing device that executes processing when such a database inquiry command is input from a terminal device.
この装置は、端末装置10から通信回線20を介してデ
ータベース問い合わせコマンド12が入力された場合、
これをデータベース管理システム30が受は付けてデー
タベース40を検索する構成の装置である。This device, when a database inquiry command 12 is input from the terminal device 10 via the communication line 20,
The database management system 30 receives this information and searches the database 40.
この端末装置10において、アプリケーションプログラ
ム11が作成され、その中にデータベース問い合わせコ
マンド12が含まれているものとする。It is assumed that an application program 11 is created in this terminal device 10 and includes a database inquiry command 12 therein.
データベース管理システム30は、例えば通信回線20
を介して図示しない多数の端末装置10を接続したホス
トコンピュータから構成される。The database management system 30 includes, for example, the communication line 20
It consists of a host computer to which a large number of terminal devices 10 (not shown) are connected via a host computer.
このデータベース管理システム30には、データベース
問い合わせコマンド12を受は入れて、オブジェクトプ
ログラム32を生成する、問い合わせ言語コンパイラ3
1(インタプリタとも呼ばれる)が設けられている。又
、ここには、データベース40をアクセスするためにデ
ータベースアクセス手段33が設けられ、そこにはデー
タベース定義情報34が用意されている。This database management system 30 includes a query language compiler 3 that receives database query commands 12 and generates object programs 32.
1 (also called an interpreter) is provided. Further, a database access means 33 is provided here to access the database 40, and database definition information 34 is prepared therein.
これは、データベース40の内容に基づいて作成された
情報で、問い合わせ言語コンパイラ31がオブジェクト
プログラム32を生成する際に使用する情報である。This is information created based on the contents of the database 40, and is information used by the query language compiler 31 when generating the object program 32.
例えば、このデータベース定義情報34は、図に示すよ
うに、データの集合の名前の情報例えば表名や列名、デ
ータの構造に関する情報例えばデータ型やデータ長、デ
ータの集合のアクセスの効率化に関する情報例えば索引
の有無や選択率、データの集合に対するアクセス権情報
等から構成されている。For example, as shown in the figure, the database definition information 34 includes information on the name of a data set, such as table name and column name, information on the structure of data, such as data type and data length, and information on efficiency of access to the data set. Information includes, for example, the presence or absence of an index, selection rate, access right information for a data set, etc.
ここで、°表名とは、第2図に示した従業員配置表等の
表データの名称のことである。又、列名とは、その氏名
とか従業員番号等の、列の名称をいう。データ型とは、
例えば氏名の場合、漢字あるいはカタカナ表示、従業員
番号の場合、数字10進数といったデータの表現方法を
表わす情報である。データ長は、各列の文字数等に関す
る情報である。索引の有無というのは、例えば第2図に
示した従業員配置表でいえば、従業員番号順索引1や所
属コード順索引2が用意されているか否かを示す情報で
ある。選択率とは、問い合わせコマンドに応じた母集団
のデータに対する検索結果のデータの割合を示すもので
、アクセス権というのは、データベース問い合わせコマ
ンド12を使用する者が、そのデータベースをアクセス
する権利を有しているか否かに関する情報である。Here, the table name is the name of table data such as the employee allocation table shown in FIG. In addition, the column name refers to the name of the column, such as the name or employee number. What is a data type?
For example, in the case of a name, it is displayed in kanji or katakana, and in the case of an employee number, it is information representing the method of representing the data, such as a decimal number. The data length is information regarding the number of characters in each column, etc. For example, in the employee allocation table shown in FIG. 2, the presence or absence of an index is information indicating whether an index 1 in order of employee number and an index 2 in order of affiliation code are prepared. The selection rate indicates the ratio of the search result data to the data of the population according to the inquiry command, and the access right refers to the ratio of the data in the search results to the population data according to the inquiry command. This is information regarding whether or not the
問い合わせ言語コンパイラ31は、データベース問い合
わせコマンド12のシンタックスチエツクを行ない、更
に、データベース定義情報34を参照しながらデータベ
ース問い合わせコマンド12をコンパイルし、オブジェ
クトプログラム32を生成する。データベースアクセス
手段33は、このオブジェクトプログラム32を使用し
てデータベース40を検索し、必要に応じてデータ型を
変換し、その検索結果をアプリケーションプログラム1
1に応答する。アプリケーションプログラム11は、こ
れによって必要なデータを取り込み所定の処理を実行し
ていく。The query language compiler 31 performs a syntax check on the database query command 12 and further compiles the database query command 12 while referring to the database definition information 34 to generate an object program 32. The database access means 33 uses this object program 32 to search the database 40, converts the data type as necessary, and sends the search results to the application program 1.
Respond to 1. The application program 11 thereby takes in necessary data and executes predetermined processing.
尚、従来、このようなリレーショナルデータベース管理
システムにおけるデータベース問い合わせコマンドのコ
ンパイルを効率的に行なう技術が、例えば特開昭62−
274433号公報等により紹介されている。Incidentally, conventional techniques for efficiently compiling database inquiry commands in such a relational database management system have been disclosed, for example, in Japanese Patent Laid-Open No.
It is introduced in Publication No. 274433 and the like.
(発明が解決しようとする課題)
ところで、このようなデータベースをアクセスするため
のアプリケーションプログラムの開発は、主としてデー
タベース定義情報が存在する計算機側で行なわれている
。ところが、データベースの大型化や開発環境の分散化
が進むにつれて、このアプリケーションプログラムの開
発時に、アクセス対象となるデータベースやそのデータ
ベース定義情報が開発中であって、まだ存在しなかった
り、たとえ存在していても内容が不十分でこれを参照で
きないといった場合が増加してきている。(Problem to be Solved by the Invention) Incidentally, the development of application programs for accessing such databases is mainly performed on the computer side where database definition information exists. However, as databases become larger and development environments become more distributed, when developing this application program, the database to be accessed and its database definition information may be under development and may not yet exist, or even if they do not exist. However, there are an increasing number of cases in which it is not possible to refer to the content because the content is insufficient.
ここで、データベース問い合わせコマンドの含まれたア
プリケーションプログラムをコンパイルする場合、デー
タベース定義情報が計算機上に存在しなければ、問い合
わせコマンドに基づくオブジェクトプログラムの生成を
行なうことができない。When compiling an application program that includes a database inquiry command, an object program cannot be generated based on the inquiry command unless database definition information exists on the computer.
従って、このような環境においては、アプリケーション
プログラムの完全なコンパイルができないという問題が
あった。Therefore, in such an environment, there is a problem that application programs cannot be completely compiled.
本発明は以上の点に着目してなされたもので、データベ
ース定義情報が存在する場合でもしない場合でも、アプ
リケーションプログラムの先行開発を可能にするプログ
ラム環境をもたらすことができるデータベース問い合わ
せ処理装置を提供することを目的とするものである。The present invention has been made in view of the above points, and provides a database inquiry processing device that can provide a program environment that enables advanced development of application programs regardless of whether database definition information exists or not. The purpose is to
(課題を解決するための手段)
本発明のデータベース問い合わせ処理装置は、入力装置
からデータベース問い合わせコマンドが入力されて、デ
ータベース管理システムが前記データベース問い合わせ
コマンドに従ってデータベースを検索し、これに応答す
るものにおいて、前記データベース管理システムは、前
記入力装置から人力した前記データベース問い合わせコ
マンドに基づいて前記検索実行用のオブジェクトプログ
ラムを生成する問い合わせ言語コンパイラと、前記オブ
ジェクトプログラムを用いて、前記データベースの検索
を実行するデータベースアクセス手段と、検索実行前に
、前記オブジェクトプログラムを点検するオブジェクト
変換手段とを有し、前記問い合わせ言語コンパイラは、
前記データベースの構成を明らかにするデータベース定
義情報が参照できる場合、データベース定義情報を参照
した実行可能なオブジェクトプログラムを生成し、前記
データベース定義情報が参照できない場合、データベー
ス定義情報の参照を省略した実行不能オブジェクトプロ
グラムを生成し、前記オブジェクト変換手段は、前記問
い合わせ言語コンパイラの生成した前記オブジェクトプ
ログラムのうち、実行不能オブジェクトプログラムを、
検索実行時にそのデータベース管理システムに備えられ
た前記データベース定義情報を参照して、実行可能オブ
ジェクトプログラムに変換するよう動作することを特徴
とするものである。(Means for Solving the Problems) A database inquiry processing device of the present invention is one in which a database inquiry command is inputted from an input device, and the database management system searches a database according to the database inquiry command and responds to the database inquiry command. The database management system includes a query language compiler that generates the object program for executing the search based on the database inquiry command manually input from the input device, and a database access system that executes the search of the database using the object program. and object conversion means for checking the object program before executing a search, the query language compiler comprising:
If database definition information that reveals the configuration of the database can be referenced, an executable object program is generated with reference to the database definition information, and if the database definition information cannot be referenced, an executable object program is generated that does not refer to the database definition information. The object converting means generates an object program, and converts an unexecutable object program among the object programs generated by the query language compiler into a non-executable object program.
The present invention is characterized in that when a search is executed, the database definition information provided in the database management system is referred to and converted into an executable object program.
(作用)
以上の装置は、データベース定義情報が存在する場合に
は、このデータベース定義情報を参照した実行可能オブ
ジェクトプログラムを生成し、それ以外の場合には、デ
ータベース定義情報に関与しない部分のシンタクスチェ
ックを行なった上で、データベース定義情報の参照を省
略した実行不能オブジェクトプログラムを生成する。こ
れによって、アプリケーションプログラムのコンパイー
ルは支障無く実行することができる。(Operation) If the database definition information exists, the above device generates an executable object program that refers to this database definition information, and in other cases, performs a syntax check on parts that are not related to the database definition information. Then, an unexecutable object program is generated that omits reference to database definition information. This allows the application program to be compiled without any problems.
一方、実際に検索を行なう場合には、オブジェクト変換
手段が実行不能オブジェクトプログラムを、そのとき既
にシステムに備えられたデータベース定義情報を参照し
て、実行可能オブジェクトプログラムに変換する。これ
によって、アプリケーションプログラム開発時には存在
しない、データベース定義情報を含めたデータベース問
い合わせコマンドを含むプログラムの開発を円滑に行な
うことができる。On the other hand, when actually performing a search, the object converting means converts an unexecutable object program into an executable object program by referring to database definition information already provided in the system. Thereby, it is possible to smoothly develop a program that includes a database inquiry command including database definition information, which does not exist when developing an application program.
(実施例) 以下、本発明を図の実施例を用いて詳細に説明する。(Example) Hereinafter, the present invention will be explained in detail using embodiments shown in the drawings.
第1図は本発明のデータベース問い合わせ処理装置の実
施例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of a database query processing device of the present invention.
この装置は、オペレータが操作する入力装置10と、デ
ータベース管理システム30とが接続された構成となっ
ている。これらは、例えば一体のホストコンピュータに
組み込まれている。This device has a configuration in which an input device 10 operated by an operator and a database management system 30 are connected. These are built into, for example, a single host computer.
入力装置10においては、アプリケーションプログラム
11が作成され、ここでそのプログラム中にデータベー
ス問い合わせコマンド12が含められており、これがデ
ータベース管理システム30に入力する。In the input device 10, an application program 11 is created, in which a database inquiry command 12 is included, and this is input into the database management system 30.
データベース管理システム3oは、データベース40を
検索するためのデータベースアクセス手段33を有し、
ここには、先に第3図を用いて説明したようなデータベ
ース定義情報34が設けられている。又、この他に、デ
ータベース問い合わせコマンド12を受は入れる問い合
わせ言語コンパイラ60と、問い合わせコマンドの実行
時に動作するオブジェクト変換手段50とが設けられて
いる。The database management system 3o has a database access means 33 for searching the database 40,
Here, database definition information 34 as previously explained using FIG. 3 is provided. In addition to this, a query language compiler 60 that receives the database query command 12 and an object conversion means 50 that operates when the query command is executed are provided.
問い合わせ言語コンパイラ6oは、問い合わせ解釈手段
61、データベース定義情報判定手段62、問い合わせ
最適化手段63、問い合わせ簡略化手段64及びオブジ
ェクト生成手段65とを有している。又、オブジェクト
変換手段50には、実行不能オブジェクトプログラム5
1あるいは実行可能オブジェクトプログラム52を受は
入れて、そのオブジェクト種別を判定するオブジェクト
種別判定手段53と、実行不能オブジェクトプログラム
51を実行可能オブジェクトプログラム55に変換する
オブジェクト変換部54とが設けられている。The query language compiler 6o includes a query interpreting means 61, a database definition information determining means 62, a query optimizing means 63, a query simplifying means 64, and an object generating means 65. The object converting means 50 also includes an unexecutable object program 5.
1 or an executable object program 52 and determines the object type thereof; and an object converting section 54 that converts the unexecutable object program 51 into an executable object program 55. .
以上の装置は、入力装置10からデータベース問い合わ
せコマンド12が入力すると、問い合わせ言語コンパイ
ラ60がデータベース定義情報34のある場合には、実
行可能オブジェクトプログラム52を生成し、データベ
ース定義情報34が無い場合には実行不能オブジェクト
プログラム51を生成する。In the above device, when a database inquiry command 12 is input from the input device 10, the query language compiler 60 generates an executable object program 52 if there is database definition information 34, and if there is no database definition information 34, the query language compiler 60 generates an executable object program 52. An unexecutable object program 51 is generated.
これによって、アプリケーションプログラム11のコン
パイルは完了する訳であるが、実際にデータベース40
の検索を行なおうとする場合には、実行不能オブジェク
トプログラム51がオブジェクト変換手段50において
、実行可能オブジェクトプログラム55に変換され、そ
の後データベースアクセス手段33がデータベース40
の検索を実行する。This completes the compilation of the application program 11, but actually the database 40
When attempting to search for
Perform a search.
第4図及び第5図に、上記実行不能オブジェクトプログ
ラム51と実行可能オブジェクトプログラム52の構成
を図示した。4 and 5 illustrate the configurations of the non-executable object program 51 and the executable object program 52.
オブジェクト種別510.520は、実行不能オブジェ
クトプログラムと実行可能オブジェクトプログラムを識
別するためのフラグ等から構成されており、このフラグ
によって第1図に示したオブジェクト変換手段50が、
オブジェクトプログラムの変換を実行するか否かを判断
する。即ち、これらの情報は、第4図の実行不能オブジ
ェクトプログラム51については、データベース定義情
報が無いため実行時に定義情報の参照を行なう指示に使
用される。又、第5図の実行可能オブジェクトプログラ
ム52については、既にデータベース定義情報が存在し
実行時の定義情報の参照は必要無く、これを抑止する指
示に使用される。The object types 510 and 520 are composed of flags for identifying non-executable object programs and executable object programs, and these flags allow the object converting means 50 shown in FIG.
Determine whether to convert the object program. That is, for the non-executable object program 51 shown in FIG. 4, since there is no database definition information, these pieces of information are used for instructions to refer to the definition information at the time of execution. Further, regarding the executable object program 52 shown in FIG. 5, database definition information already exists and there is no need to refer to the definition information at the time of execution, and it is used as an instruction to suppress this.
次に表識別情報511.521は、第2図に説明したよ
うな表データの表名を処理する部分で、実行不能オブジ
ェクトプログラム51については表名がそのまま入力さ
れ、実行可能オブジェクトプログラム52についてはデ
ータベース定義情報34により定義された表idを入力
する。この表idは、各データベースの表についてそれ
を識別するための符号である。Next, the table identification information 511.521 is a part that processes the table name of table data as explained in FIG. The table ID defined by the database definition information 34 is input. This table ID is a code for identifying the table of each database.
又、列識別情報512あるいは522は、第2゛図に示
した氏名等の列を表わす情報で、実行不能オブジェクト
プログラム51については列名をそのまま入力し、実行
可能オブジェクトプログラム52については、表の指令
と同様の列idとその列を構成するデータのデータ型情
報とが書き込まれる。Column identification information 512 or 522 is information representing a column such as name shown in FIG. A column ID similar to the command and data type information of data forming the column are written.
又、問い合わせ条件513あるいは523には、表を検
索するためのキーやアンド、オア等の検索条件等が入力
される。これは、プログラムの実行に便利なように簡略
化が施され、又、データベース定義情報を参照した場合
には、そのデータベースに最適の検索方法に最適化され
る。尚、このような最適化の具体的な手法は、例えば先
に紹介した特開昭62−274433号公報等に記載さ
れている。この最適化によって、同じ検索を行なう場合
でもプログラムの実行時間を最小限に圧縮することがで
きる。Further, in the inquiry condition 513 or 523, search conditions such as keys, AND, or, etc. for searching the table are input. This is simplified for convenience in program execution, and when database definition information is referenced, it is optimized to the best search method for that database. Note that a specific method of such optimization is described, for example, in Japanese Patent Application Laid-Open No. 62-274433 introduced above. This optimization allows the program execution time to be minimized even when performing the same search.
又、データ型変換情報514あるいは524には、デー
タベースから読み出されたデータのデータ型とアプリケ
ーションプログラム11で要求しているデータ型とが異
なる場合に、その変換を実行する情報が入力される。実
行不能オブジェクトプログラム51については、データ
ベース側のデータ型が不明なため未完成であるが、実行
可能オブジェクトプログラム52については、データ型
変換情報が完成した形で人力される。Further, in the data type conversion information 514 or 524, information for executing the conversion when the data type of data read from the database and the data type requested by the application program 11 are different is input. The non-executable object program 51 is incomplete because the data type on the database side is unknown, but the executable object program 52 is manually entered with data type conversion information completed.
最後にアクセス経路情報515あるいは525は、検索
作業の際参照する表や索引等の情報で、実行不能オブジ
ェクトプログラム51では、索引の存在の有無等は不明
であるから未完成であり、実行可能オブジェクト52に
ついてはこれが完成された形で入力される。Finally, the access route information 515 or 525 is information such as tables and indexes that are referred to during search operations. 52 is input in its completed form.
第1図における問い合わせ言語コンパイラ60は、この
ように第4図や第5図に示したオブジェクトプログラム
を生成する動作を行なうが、その動作をフローチャート
を用いて更に具体的に説明する。The query language compiler 60 in FIG. 1 performs the operation of generating the object program shown in FIGS. 4 and 5 in this way, and the operation will be explained in more detail using a flowchart.
第6図は、問い合わせ言語コンパイラ60の動作フロー
チャートである。FIG. 6 is an operational flowchart of the query language compiler 60.
先ず、問い合わせコマンドが入力すると問い合わせ解釈
手段61(第1図)においてシンタックスチエツクが実
行される(ステップSl)。これはいわゆる文法のチエ
ツクで、入力コマンドにタイプミスや文法上のミスがあ
った場合のチエツクを行なう処理である。First, when an inquiry command is input, a syntax check is executed in the inquiry interpretation means 61 (FIG. 1) (step Sl). This is a so-called grammar check, and is a process to check if there are typographical or grammatical errors in the input command.
次に、データベース定義情報34(第1図)を参照する
(ステップS2)。データベース定義情報判定手段62
(第1図)は、データベースアクセス手段33に対し、
目的とするデータベースのデータベース定義情報34が
用意されているか否かの問い合わせを行ない、定義情報
があった場合にはステップS4の処理に進み、無い場合
にはステップS7の処理に進む(ステップS3)。Next, the database definition information 34 (FIG. 1) is referred to (step S2). Database definition information determining means 62
(FIG. 1) shows that for the database access means 33,
An inquiry is made as to whether the database definition information 34 of the target database is prepared, and if the definition information is present, the process proceeds to step S4; if not, the process proceeds to step S7 (step S3). .
データベース定義情報34があった場合、その定義情報
の取り込みを行なう(ステップS4)。If there is database definition information 34, the definition information is imported (step S4).
そして、問い合わせ最適化手段63(第1図)の呼出し
を行なう。この問い合わせ最適化手段63は、第5図に
示した実行可能オブジェクトプログラム52を生成する
ためのプログラムである。この処理によって、実行可能
オブジェクトプログラム52が生成され(ステップS6
)、コンパイルが終了する。Then, the query optimization means 63 (FIG. 1) is called. This query optimization means 63 is a program for generating the executable object program 52 shown in FIG. Through this process, the executable object program 52 is generated (step S6
), compilation ends.
一方、定義情報が無い場合については、問い合わせ簡略
化手段64(第1図)の呼出しが行なわれる(ステップ
S7)。これは、第4図に示したような実行不能なオブ
ジェクトプログラム51を生成するプログラムである。On the other hand, if there is no definition information, the inquiry simplifying means 64 (FIG. 1) is called (step S7). This is a program that generates an unexecutable object program 51 as shown in FIG.
そして、実行不能オブジェクトプログラムが生成される
と(ステップS8)、このコンパイルが完了する。Then, when the non-executable object program is generated (step S8), this compilation is completed.
以上の問い合わせ言語コンパイラ6oの動作によって、
データベース定義情報の有無にかかわりなく、アプリケ
ーションプログラムのデータベース問い合わせコマンド
に関するコンパイルが完了する。Due to the above operation of the query language compiler 6o,
Compilation of the application program regarding the database inquiry command is completed regardless of the presence or absence of database definition information.
第7図は、第1図に示した問い合わせ最適化手段のより
具体的な動作を説明するフローチャートである。FIG. 7 is a flowchart illustrating a more specific operation of the query optimization means shown in FIG.
先ず、始めに、問い合わせコマンドの内容から、第1図
に示したデータベース定義情報34中の表情報を取り込
む(ステップSl)。そして、この表情報の中に検索要
求のあった列が存在するか否かの判断をする(ステップ
S2)。列が存在すれば、データベース定義情報34を
参照して列情報の取り込みを行なう(ステップS3)。First, table information in the database definition information 34 shown in FIG. 1 is fetched from the contents of the inquiry command (step Sl). Then, it is determined whether or not the column requested for search exists in this table information (step S2). If a column exists, the column information is imported by referring to the database definition information 34 (step S3).
列が表に存在しなければ、この処理は行なわない。This process is not performed if the column does not exist in the table.
そして、次に、問い合わせのデータ型とデータベース定
義情報中のデータ型が同じか否かを判断する(ステップ
S4)。ここで、データ型が同一であれば、変換の必要
がないためステップS7に移行する。又、データ型が同
一でない場合、そのデータ型の変換が可能な否かを判断
する(ステップS5)゛。そして、データ型変換が不能
ならばステップS7に移行し、可能であればデータ型変
換を実行する(ステップS6)。Then, it is determined whether the data type of the inquiry and the data type in the database definition information are the same (step S4). Here, if the data types are the same, there is no need for conversion and the process moves to step S7. If the data types are not the same, it is determined whether the data types can be converted (step S5). If data type conversion is not possible, the process moves to step S7, and if possible, data type conversion is executed (step S6).
次に、問い合わせ条件の簡略化が可能か否かを判断する
(ステップS7)。簡略化が可能であれば、条件の組み
替え等によってその簡略化を実行する(ステップS8)
。簡略化が不可能であれば、次のステップS9にそのま
ま進む。ステップS9においては、アクセス経路の決定
を行なう。Next, it is determined whether the inquiry conditions can be simplified (step S7). If simplification is possible, perform the simplification by rearranging the conditions, etc. (step S8)
. If simplification is not possible, the process directly proceeds to the next step S9. In step S9, an access route is determined.
ソシテ、最後に問い合わせオブジェクト種別を設定する
(ステップ510)。Finally, the inquiry object type is set (step 510).
以上のようにして、実行可能オブジェクトプログラム5
2が生成される。As described above, executable object program 5
2 is generated.
一方、実行不能オブジェクトプログラムの生成を行なう
問い合わせ簡略化手段64においては、第7図における
ステップS7で、問い合わせ条件の簡略化が可能か否か
を判断し、簡略化が可能であればそれを実行しくステッ
プS8)、オブジェクト種別を決定する(ステップ51
0)という3つのステップの処理のみを行なう。。On the other hand, the query simplification means 64 that generates an unexecutable object program determines whether the query conditions can be simplified in step S7 in FIG. (step S8), and determines the object type (step S51).
Only the three steps 0) are performed. .
次に、このようにコンパイルされたプログラムが実際に
データベース40を検索しようとする場合には、第1図
に示したオブジェクト変換手段50において、これが実
行可能なオブジェクトプログラムか実行不能なオブジェ
クトプログラムかが判定される。この判定は、オブジェ
クト種別判定手段53によって、第4図あるいは第5図
に示したオブジェクト種別510あるいは520を識別
して判定を行なう。ここで、実行不能なオブジェクトプ
ログラムであると判定した場合には、オブジェクト変換
部54がそのプログラムの変換を実行して実行可能オブ
ジェクトプログラムを得る。Next, when the program compiled in this way actually attempts to search the database 40, the object conversion means 50 shown in FIG. It will be judged. This determination is made by the object type determining means 53 identifying the object type 510 or 520 shown in FIG. 4 or 5. Here, if it is determined that the object program is not executable, the object conversion unit 54 converts the program to obtain an executable object program.
このオブジェクト変換部54は、第7図に示したと全く
同様の処理を実行して、実行不能オブジェクト51を実
行可能オブジェクト55に変換する。その後、データベ
ースアクセス手段33が実行可能オブジェクトプログラ
ムを使用して、データベース40を実際に検索し、その
検索結果をアプリケーションプログラム11に対して応
答する。This object converting unit 54 converts the non-executable object 51 into an executable object 55 by executing the process completely similar to that shown in FIG. Thereafter, the database access means 33 uses the executable object program to actually search the database 40 and responds the search results to the application program 11.
本発明は以上の実施例に限定されない。The present invention is not limited to the above embodiments.
上記実施例においては、データベースとしてリレーショ
ナルデータベースを例示して説明したが、例えば階層別
データベース、ネットワーク型データベース等について
も同様の適用が可能である。又、そのオブジェクトプロ
グラムの構成等については、データベースの種類に応じ
て各種変形が可能である。又、問い合わせ言語コンパイ
ラやオブジェクト変換手段等の構成、その動作等にって
も、上記機能を有する範囲で適宜その内容を変更して差
し支えない。In the above embodiments, a relational database is used as an example of the database, but the present invention can be similarly applied to, for example, a hierarchical database, a network type database, and the like. Furthermore, the structure of the object program can be modified in various ways depending on the type of database. Furthermore, the structure and operation of the query language compiler, object conversion means, etc. may be modified as appropriate as long as the above functions are provided.
(発明の効果)
以上説明した本発明のデータベース問い合わせ処理装置
によれば、既にデータベース定義情報が存在する場合に
は、最適なデータベースの検索を実行するためのオブジ
ェクトプログラムを生成することができる。一方、若し
データベース定義情報が存在しない場合でも、データベ
ース問い合わせコマンドに対し必要なシンタックスチエ
ツクを行ない、実行時には、直ちにデータベース定義情
報を参照して検索ができるオブジェクトプログラムを生
成する。これにより、様々な開発環境において、データ
ベース問い合わせプログラムの開発を円滑に進めること
ができる。(Effects of the Invention) According to the database inquiry processing device of the present invention described above, when database definition information already exists, it is possible to generate an object program for executing an optimal database search. On the other hand, even if the database definition information does not exist, a necessary syntax check is performed on the database inquiry command, and upon execution, an object program that can immediately refer to the database definition information and perform a search is generated. This allows the development of database inquiry programs to proceed smoothly in various development environments.
第1図は本発明のデータベース問い合わせ処理装置のブ
ロック図、第2図は本発明の実施に適するリレーショナ
ルデータベースの説明図、第3図は従来のデータベース
問い合わせ処理装置のブロック図、第4図は実行不能オ
ブジェクトプログラムの説明図、第5図は実行可能オブ
ジェクトプログラムの説明図、第6図は問い合わせ言語
コンパイラの動作フローチャート、第7図はその問い合
わせ最適化手段の動作を説明するフローチャートである
。
10・・・入力装置、
11・・・アプリケーションプログラム、12・・・デ
ータベース問い合わせコマンド、30・・・データベー
ス管理システム、33・・・データベースアクセス手段
、34・・・データベース定義情報、
40・・・データベース、
50・・・オブジェクト変換手段、
51・・・実行不能オブジェクトプログラム、52・・
・実行可能オブジェクトプログラム、53・・・オブジ
ェクト種別判定手段、54・・・オブジェクト変換部、
55・・・実行可能オブジェクトプログラム、6o・・
・問い合わせ言語コンパイラ、61・・・問い合わせ解
釈手段、
62・・・データベース定義情報判定手段、63・・・
問い合わせ最適化手段、
64・・・問い合わせ簡略化手段、
65・・・オブジェクト生成手段。
特許出願人 沖電気工業株式会社
実行不能オブジェクト 実行可能オブジェ
クト第4図 第5図
第6図
□を凶FIG. 1 is a block diagram of a database query processing device of the present invention, FIG. 2 is an explanatory diagram of a relational database suitable for implementing the present invention, FIG. 3 is a block diagram of a conventional database query processing device, and FIG. 4 is an execution diagram. FIG. 5 is an explanatory diagram of an executable object program, FIG. 6 is a flowchart of the operation of the query language compiler, and FIG. 7 is a flowchart of the operation of the query optimization means. DESCRIPTION OF SYMBOLS 10... Input device, 11... Application program, 12... Database inquiry command, 30... Database management system, 33... Database access means, 34... Database definition information, 40... Database, 50... Object conversion means, 51... Unexecutable object program, 52...
- Executable object program, 53... Object type determination means, 54... Object converter, 55... Executable object program, 6o...
- Inquiry language compiler, 61... Inquiry interpretation means, 62... Database definition information determination means, 63...
Query optimization means, 64... Query simplification means, 65... Object generation means. Patent applicant: Oki Electric Industry Co., Ltd.
Claims (1)
れて、データベース管理システムが前記データベース問
い合わせコマンドに従ってデータベースを検索し、これ
に応答するものにおいて、前記データベース管理システ
ムは、 前記入力装置から入力した前記データベース問い合わせ
コマンドに基づいて前記検索実行用のオブジェクトプロ
グラムを生成する問い合わせ言語コンパイラと、 前記オブジェクトプログラムを用いて、前記データベー
スの検索を実行するデータベースアクセス手段と、 検索実行前に、前記オブジェクトプログラムを点検する
オブジェクト変換手段とを有し、前記問い合わせ言語コ
ンパイラは、 前記データベースの構成を明らかにするデータベース定
義情報が参照できる場合、データベース定義情報を参照
した実行可能オブジェクトプログラムを生成し、 前記データベース定義情報が参照できない場合、データ
ベース定義情報の参照を省略した実行不能オブジェクト
プログラムを生成し、 前記オブジェクト変換手段は、 前記問い合わせ言語コンパイラの生成した前記オブジェ
クトプログラムのうち、実行不能オブジェクトプログラ
ムを、検索実行時にそのデータベース管理システムに備
えられた前記データベース定義情報を参照して、実行可
能オブジェクトプログラムに変換するよう動作すること
を特徴とするデータベース問い合わせ処理装置。[Scope of Claims] A database inquiry command is input from an input device, and the database management system searches the database according to the database inquiry command and responds to the database inquiry command, wherein the database management system comprises: a query language compiler that generates the object program for executing the search based on the database inquiry command; a database access means that executes the search of the database using the object program; and an object conversion means for checking, the query language compiler: if database definition information clarifying the configuration of the database can be referenced, generates an executable object program with reference to the database definition information; If the object cannot be referenced, an unexecutable object program is generated with reference to the database definition information omitted, and the object converting means converts the unexecutable object program among the object programs generated by the query language compiler into a non-executable object program during search execution. A database inquiry processing device, characterized in that it operates to convert into an executable object program by referring to the database definition information provided in a database management system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63058358A JPH01232428A (en) | 1988-03-14 | 1988-03-14 | Data base enquiry processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63058358A JPH01232428A (en) | 1988-03-14 | 1988-03-14 | Data base enquiry processor |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH01232428A true JPH01232428A (en) | 1989-09-18 |
Family
ID=13082096
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63058358A Pending JPH01232428A (en) | 1988-03-14 | 1988-03-14 | Data base enquiry processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH01232428A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009086992A (en) * | 2007-09-28 | 2009-04-23 | Ns Solutions Corp | Information processing apparatus, information processing method, and program |
-
1988
- 1988-03-14 JP JP63058358A patent/JPH01232428A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009086992A (en) * | 2007-09-28 | 2009-04-23 | Ns Solutions Corp | Information processing apparatus, information processing method, and program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6219831B1 (en) | Device and method for converting computer programming languages | |
KR890002329B1 (en) | Tabular Language Translator | |
EP0134897B1 (en) | Method for allowing a program to be independent of the national language in which an input to the data processing system is received | |
AU671137B2 (en) | Programmable computer with automatic translation between source and object code with version control | |
US5802523A (en) | Method and apparatus for reducing the memory required to store bind variable descriptors in a database | |
US5732274A (en) | Method for compilation using a database for target language independence | |
US5590039A (en) | Natural language processing apparatus and method for performing processing to analyze the meaning of an input sentence entered in the form of a natural language | |
US4692896A (en) | Method of processing a plurality of code systems | |
US20090024384A1 (en) | Data processing method and system, program for realizing the method, and computer readable storage medium storing the program | |
EP0667586A2 (en) | Database generator | |
US5394546A (en) | Database management system and method of extending system functions | |
JPH05224949A (en) | Method and apparatus for converting abstract syntax in high-level configuration into intermediate configuration | |
US5557788A (en) | Relational access system for network type data bases which uses a unique declarative statement | |
JPH0636168B2 (en) | Machine translation processor | |
Kataria et al. | Natural language interface for databases in Hindi based on karaka theory | |
JPH01232428A (en) | Data base enquiry processor | |
KR0133406B1 (en) | Dynamic Coversion Method of Retrieval Statement Concering Korean Language Information Retrieval | |
Garvin | Syntax in machine translation | |
JPH01232427A (en) | Data base enquiry processor | |
KR0123247B1 (en) | Data Manipulation Processing Method for Real-time Support of DBMS | |
JPH07160490A (en) | Coding assistance device | |
CN116756184B (en) | Database instance processing method, device, equipment, storage medium and program product | |
WO2001018657A1 (en) | Dynamic content identifier for xml web pages | |
JPH0394374A (en) | Data base operating device | |
JPH0390933A (en) | Automatic generating system for software program |