JP2003140922A - Sql debugging method of different type of database system and its system - Google Patents

Sql debugging method of different type of database system and its system

Info

Publication number
JP2003140922A
JP2003140922A JP2001339265A JP2001339265A JP2003140922A JP 2003140922 A JP2003140922 A JP 2003140922A JP 2001339265 A JP2001339265 A JP 2001339265A JP 2001339265 A JP2001339265 A JP 2001339265A JP 2003140922 A JP2003140922 A JP 2003140922A
Authority
JP
Japan
Prior art keywords
sql
user
information
statement
host variable
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.)
Granted
Application number
JP2001339265A
Other languages
Japanese (ja)
Other versions
JP3695528B2 (en
Inventor
Azuma Sawada
東 澤田
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2001339265A priority Critical patent/JP3695528B2/en
Publication of JP2003140922A publication Critical patent/JP2003140922A/en
Application granted granted Critical
Publication of JP3695528B2 publication Critical patent/JP3695528B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an SQL debugging method of a different type of database system for facilitating debug of an error in executing an SQL occurring in the different type of database system, and its system. SOLUTION: A database access common library 3 holds information of an SQL sentence and a host variable value in a corresponding region in an SQL information table 6 in executing the SQL sentence and assigning the host variable to the SQL sentence in a user executing program 1. When an SQL execution error occurs in the user executing program, an SQL information obtaining part 7 is called from an error processing part of the user executing program, a current table 5 in the error occurrence time in the user executing program or the information of the SQL sentence and the host variable value corresponding to SQL registering information specified by a user is obtained from an SQL information table, and the information is returned to the user executing program.

Description

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

【0001】[0001]

【発明の属する技術分野】異種データベースシステムSQ
L(構造化問い合わせ言語)デバッグ方法及びそのシス
テムに関する。
FIELD OF THE INVENTION Heterogeneous database system SQ
The present invention relates to an L (structured query language) debugging method and its system.

【0002】[0002]

【従来の技術】データベースにアクセスするプログラム
を作成する場合、複数のSQL文を実行することが多く、S
QL実行時にエラーが発生した際、そのデバッグのための
情報をユーザが管理する必要があった。
2. Description of the Related Art When creating a program that accesses a database, it is often the case that multiple SQL statements are executed.
When an error occurred during QL execution, the user had to manage information for debugging the error.

【0003】[0003]

【発明が解決しようとする課題】上述の従来の技術にお
いては、既に完成しているアプリケーションプログラム
の修正・変更を行う場合は、ローカル変数をグローバル
変数に変更するなど、広範囲に、また、細心の注意を必
要とする変更となり、非常に工数の掛かる作業となって
いた。また、対象となるDBMS(データベース管理システ
ム)によっては、直前に実行したSQL文を取得できるイ
ンターフェイスを持つものもあるが、これで取得できる
ものはSQL文そのものであり、その実行時にホスト変数
として割り当てられていた値まで取得できるものはなか
った。さらに、対象となるDBMSにより、インターフェイ
スが異なり、それを意識したプログラミングをする必要
があり、移植性が損なわれるなどの問題があった。
In the above-mentioned conventional technique, when modifying / changing an already completed application program, a local variable is changed to a global variable, so that a wide range of details are required. It was a change that requires attention, and it took a lot of work. Also, depending on the target DBMS (database management system), there is one that has an interface that can acquire the SQL statement executed immediately before, but the one that can be acquired with this is the SQL statement itself, and it is assigned as a host variable at the time of execution. There was nothing that could be acquired up to the specified value. In addition, the interface differs depending on the target DBMS, and it is necessary to perform programming in consideration of the interface, which causes problems such as impairing portability.

【0004】そこで、提供する実行・開発環境におい
て、各DBMSの差異を吸収し、ユーザがSQLデバッグのた
め必要となる情報を保持・返却する機能を持てば、ユー
ザ実行プログラムの作成や修正の際、デバッグのために
最小限の設計を行えばよく、また、DBMSを意識しないコ
ーディングとなるため、大幅な工数削減が可能となる。
Therefore, if the provided execution / development environment has a function of absorbing the differences between the DBMSs and retaining / returning the information required by the user for SQL debugging, it is possible to create or modify the user execution program. , It is only necessary to do the minimum design for debugging, and because the coding is not conscious of the DBMS, it is possible to significantly reduce the number of steps.

【0005】本発明の目的は、異種データベースシステ
ムで発生したSQL実行時エラーのデバックを容易にする
異種データベースシステムSQLデバッグ方法及びそのシ
ステムを提供することにある。
It is an object of the present invention to provide a heterogeneous database system SQL debugging method and system for facilitating debugging of SQL runtime errors that have occurred in the heterogeneous database system.

【0006】[0006]

【課題を解決するための手段】本発明の異種データベー
スシステムSQLデバッグシステムは、第1のDBMSと、第
1のDBMSと異種の第2のDBMSと、第1及び第2のDBMSを
アクセスするユーザ実行プログラムと、ユーザ実行プロ
グラムを実行するために必要な実行環境とを備え、ユー
ザ実行プログラムは、ユーザが定義したソースプログラ
ムをコンパイルすることで生成され、実行環境は、第1
のDBMS用固有処理(データベースアクセス)ライブラリ
と、第2のDBMS用固有処理(データベースアクセス)ラ
イブラリと、ユーザ実行プログラムからのデータベース
アクセス要求により使用する第1又は第2のDBMS用固有
処理(データベースアクセス)ライブラリを切り分ける
データベースアクセス共通ライブラリとを備え、データ
ベースアクセス共通ライブラリは、データベースアクセ
ス共通処理部と、複数のSQL情報テーブルと、SQL情報取
得部とを備え、データベースアクセス共通処理部は、最
後に実行されたSQL文およびホスト変数値の情報を記憶
するカレントテーブルを備え、ソースプログラムは、ホ
スト変数を保持する2種類のSQL文を用いDBMSにアクセ
スし、データベースアクセス共通ライブラリは、ユーザ
実行プログラムにおいて、SQL文の実行時、および、SQL
文に対するホスト変数の割り当て時のそれぞれにおい
て、SQL文およびホスト変数値の情報をSQL情報テーブル
の対応する領域に保持し、ユーザ実行プログラムにおい
て、SQL実行エラーが発生した場合、ユーザ実行プログ
ラムのエラー処理部からSQL情報取得部が呼び出され、
ユーザ実行プログラムにおいてエラーが発生した時点の
カレントテーブル、又は、ユーザが指定するSQL登録情
報に対応するSQL文及びホスト変数値の情報をSQL情報テ
ーブルから取得し、ユーザ実行プログラムに返却する。
A heterogeneous database system SQL debug system according to the present invention includes a first DBMS, a second DBMS different from the first DBMS, and a user who accesses the first and second DBMSs. An execution program and an execution environment necessary for executing the user execution program are provided, and the user execution program is generated by compiling a source program defined by the user.
Peculiar processing (database access) library for DBMS, second peculiar processing (database access) library for DBMS, and first or second peculiar processing (database access) for use by a database access request from a user execution program ) A database access common library that divides the library is provided. The database access common library includes a database access common processing unit, a plurality of SQL information tables, and an SQL information acquisition unit. The source program accesses the DBMS using two types of SQL statements that hold the host variables, and the database access common library uses the current table to store the stored SQL statement and the information of the host variable value. SQL statement At runtime and SQL
Each time a host variable is assigned to a statement, information about the SQL statement and host variable value is retained in the corresponding area of the SQL information table, and if an SQL execution error occurs in the user execution program, error processing of the user execution program The SQL information acquisition part is called from the department,
Acquires the current table at the time when an error occurs in the user execution program, or the SQL statement and host variable value information corresponding to the SQL registration information specified by the user from the SQL information table and returns it to the user execution program.

【0007】また、ソースプログラムは、ホスト変数を
保持するSQL文を用いるSQL登録関数とSQL実行関数とSQL
エラー情報取得関数とを有してもよい。
Further, the source program is composed of an SQL registration function, an SQL execution function, and an SQL which use an SQL statement holding a host variable.
An error information acquisition function may be included.

【0008】本発明の異種データベースシステムSQLデ
バッグシステムは、上述の異種データベースシステムSQ
Lデバッグシステムを用いた異種データベースシステムS
QLデバッグ方法であって、ユーザ実行プログラムからDB
MSに対するSQL文登録要求を受ける第1のステップと、
登録要求されるSQL文にホスト変数が存在するかを判断
する第2のステップと、第2のステップにて、登録要求
されるSQL文にホスト変数が存在する場合に、SQL情報テ
ーブルを確保し、SQL文の記憶およびホスト変数値の初
期化の準備を行い第4のステップへ進む第3のステップ
と、第2のステップにて、登録要求されるSQL文にホス
ト変数が存在しない場合に、登録要求されるSQL文に対
するホスト変数の割り当てが実行された場合、SQL文及
びホスト変数値をSQL情報テーブルに設定する第4のス
テップと、登録されたSQL文を実行し、対応するSQL文に
対するホスト変数値をSQL情報テーブルに設定する第5
のステップと、ユーザ実行プログラムにおいて、SQL実
行エラーが発生した際、ユーザ実行プログラムからSQL
情報取得部を呼び出す第6のステップと、SQL情報テー
ブルで保持しているSQL実行エラーが発生した時点のカ
レントテーブル又はユーザが指定するSQL登録情報に対
応するSQL文のホスト変数値をSQL文中のホスト変数値と
置き換え、SQL文及びホスト変数値の情報をユーザに返
却する第7のステップとを有する。
The heterogeneous database system SQL debug system of the present invention is based on the above-mentioned heterogeneous database system SQ.
Heterogeneous database system S using L debug system
It is a QL debugging method, and the DB is
The first step to receive the SQL statement registration request to MS,
In the second step of judging whether the host variable exists in the SQL statement requested to be registered, and in the second step, when the host variable exists in the SQL statement requested to be registered, the SQL information table is secured. , If the host variable does not exist in the SQL statement that is requested to be registered in the third step, which prepares for storage of the SQL statement and initialization of the host variable value and proceeds to the fourth step, and the second step, When the host variable is assigned to the SQL statement that is requested to be registered, the fourth step of setting the SQL statement and host variable value in the SQL information table, and executing the registered SQL statement and executing the corresponding SQL statement Fifth setting host variable value in SQL information table
When a SQL execution error occurs in the step
The sixth step of calling the information acquisition part and the host variable value of the SQL statement corresponding to the SQL registration information specified by the current table or the user when the SQL execution error held in the SQL information table occurs in the SQL statement The seventh step of replacing the host variable value and returning the information of the SQL statement and the host variable value to the user.

【0009】従って、本発明は、ユーザの記述したソー
スプログラムにおいて、ユーザに煩雑なデバッグを目的
としたコードを記述させることなく、共通のインターフ
ェイスを用いて異種データベースシステムで発生したSQ
L実行時エラーのデバックを容易にすることを特徴とす
る。
Therefore, according to the present invention, in a source program written by a user, an SQ generated in a heterogeneous database system by using a common interface without causing the user to write a code for complicated debugging is described.
L is characterized by facilitating debugging of run-time errors.

【0010】即ち、ユーザが対象DBMSを意識することな
く、SQL実行エラーのデバッグを行うことができる。ま
た、本来、登録したSQL情報は、プログラムを作成する
ユーザ自身が意識して管理すべき情報であるが、本発明
により、既に作成されているユーザ実行プログラムに大
きな変更を加えることなくSQL実行エラーのデバッグを
行うことができる。これにより、ユーザがSQL実行エラ
ーのデバッグを行う際の工数の大幅な削減が可能とな
る。
That is, the user can debug the SQL execution error without being aware of the target DBMS. Originally, the registered SQL information is information that the user who creates the program should be aware of and manage, but according to the present invention, the SQL execution error can be made without making a large change to the user execution program that has already been created. Can be debugged. As a result, it is possible to significantly reduce the man-hours required for the user to debug SQL execution errors.

【0011】また、ソースプログラムが、SQL登録関
数、SQL実行関数、および、SQLエラー情報取得関数持つ
場合、ホスト変数を保持するSQL文を用いることによ
り、ユーザが管理すべき変数が、ローカル変数やグロー
バル変数と意識することなく利用することができ、ま
た、プログラム変更も容易であるなど、プログラムの生
産性および保守性を向上させることが可能となる。
When the source program has an SQL registration function, an SQL execution function, and an SQL error information acquisition function, the variables to be managed by the user are local variables and It can be used without being aware of it as a global variable, and the program can be easily changed, so that the productivity and maintainability of the program can be improved.

【0012】[0012]

【発明の実施の形態】以下図面を参照しつつ実施の形態
に従って説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments will be described below with reference to the drawings.

【0013】(発明の第1の実施の形態)図1は本発明
の第1の実施の形態の構成を示し、本発明を2種類の異
なったベンダによるDBMSに接続し、アクセスを実施する
例である。図2は図1のデータベースアクセス共通処理
部4およびSQL情報取得部7の処理説明図である。図1
中、12はユーザが定義したソースプログラム、1はソ
ースプログラム12をコンパイルすることで生成される
ユーザ実行プログラム、2はユーザ実行プログラム1を
実行するために必要な実行環境、3はユーザ実行プログ
ラムからのデータベースアクセス要求により使用する各
社製DBMS用固有処理(データベースアクセス)ライブラ
リを切り分けるデータベースアクセス共通ライブラリで
ある。ユーザが定義したソースプログラム12では、ホ
スト変数を保持する2種類のSQL文を用いDBMSにアクセ
スする。データベースアクセス共通ライブラリ3は、デ
ータベースアクセス共通処理部4、SQL情報テーブル
6、およびSQL情報取得部7を持つ。データベースアク
セス共通処理部4は、最後に実行されたSQL文およびホ
スト変数値の情報を記憶するカレントテーブル5を持
つ。8はA社製DBMS10に対し接続およびアクセスする
ためのA社製DBMS用固有処理(データベースアクセス)
ライブラリ、9はB社製DBMS11に対し接続およびアク
セスするためのB社製DBMS用固有処理(データベースア
クセス)ライブラリである。
(First Embodiment of the Invention) FIG. 1 shows the configuration of the first embodiment of the present invention. An example in which the present invention is connected to a DBMS by two different vendors and access is performed. Is. FIG. 2 is a process explanatory diagram of the database access common processing unit 4 and the SQL information acquisition unit 7 of FIG. Figure 1
In the figure, 12 is a source program defined by the user, 1 is a user execution program generated by compiling the source program 12, 2 is an execution environment required to execute the user execution program 1, and 3 is from the user execution program. This is a database access common library that separates the proprietary processing (database access) library for each DBMS used by each company according to the database access request. The source program 12 defined by the user accesses the DBMS using two types of SQL statements holding host variables. The database access common library 3 has a database access common processing unit 4, a SQL information table 6, and a SQL information acquisition unit 7. The database access common processing unit 4 has a current table 5 that stores information on the last executed SQL statement and host variable value. 8 is peculiar processing for A company's DBMS for connecting to and accessing A company's DBMS 10 (database access)
A library 9 is a unique processing (database access) library for the DBMS of B company for connecting and accessing the DBMS 11 of B company.

【0014】データベースアクセス共通ライブラリ3
は、ユーザ実行プログラム1において、SQL文の実行
時、および、SQL文に対するホスト変数の割り当て時の
それぞれにおいて、SQL文およびホスト変数値の情報をS
QL情報テーブル6の対応する領域に保持する。ユーザ実
行プログラム1において、SQL実行エラーが発生した場
合、ユーザ実行プログラム1のエラー処理部からSQL情
報取得部7が呼び出され、ユーザ実行プログラム1にお
いてエラーが発生した時点のカレントテーブル5、また
は、ユーザが指定するSQL登録情報に対応するSQL文およ
びホスト変数値の情報をSQL情報テーブル6から取得
し、ユーザ実行プログラム1に返却する。データベース
アクセス共通ライブラリ3の内部に、SQL情報テーブル
6、およびSQL情報取得部7を持つことにより、各社製D
BMS10および11や、各社製DBMS用固有処理ライブラ
リ8および9の持つ機能を意識することなく、SQL情報
を提供することが可能となる。
Database access common library 3
S in the user execution program 1 at the time of executing the SQL statement and at the time of assigning the host variable to the SQL statement, respectively
It is held in the corresponding area of the QL information table 6. When an SQL execution error occurs in the user execution program 1, the SQL information acquisition unit 7 is called from the error processing unit of the user execution program 1, and the current table 5 at the time when the error occurs in the user execution program 1 or the user The information about the SQL statement and the host variable value corresponding to the SQL registration information specified by is acquired from the SQL information table 6 and returned to the user execution program 1. By having the SQL information table 6 and the SQL information acquisition unit 7 inside the database access common library 3, each company's D
It becomes possible to provide SQL information without being aware of the functions of the BMSs 10 and 11 and the DBMS-specific processing libraries 8 and 9 manufactured by each company.

【0015】次に図2を用いてデータベースアクセス共
通ライブラリ3を中心とした本実施の形態の動作を示
す。まず、処理40はユーザ実行プログラム1からDBMS
に対するSQL文登録要求を受け、処理41にて、登録要
求されるSQL文にホスト変数が存在するかを判断する。
処理42は、処理41にて登録要求されるSQL文にホス
ト変数が存在した場合に、SQL情報テーブル6を確保
し、SQL文の記憶およびホスト変数値の初期化等の準備
を行う。処理43は、登録要求されるSQL文に対するホ
スト変数の割り当てが実行された場合、そのSQL文及び
ホスト変数値をSQL情報テーブル6に設定する。処理4
4は、登録されたSQL文の実行であるが、このタイミン
グでも、対応するSQL文に対するホスト変数値をSQL情報
テーブル6に設定する。処理51は、ユーザ実行プログ
ラム1において、SQL実行エラーが発生した際、ユーザ
実行プログラム1からSQL情報取得部7が呼び出される
処理である。処理52は、SQL情報テーブル6で保持し
ているSQL実行エラーが発生した時点のカレントテーブ
ル5またはユーザの指定したSQL登録情報に対応したSQL
文のホスト変数値をSQL文中のホスト変数'?'と置き換
え、そのSQL文及びホスト変数値の情報をユーザに返却
する。
Next, the operation of the present embodiment centering on the database access common library 3 will be described with reference to FIG. First, the process 40 is from the user execution program 1 to the DBMS.
In response to the SQL statement registration request for, the process 41 determines whether a host variable exists in the SQL statement requested to be registered.
A process 42 secures the SQL information table 6 when the SQL statement requested to be registered in the process 41 has a host variable, and prepares for storage of the SQL statement and initialization of the host variable value. The process 43 sets the SQL statement and the host variable value in the SQL information table 6 when the host variable is assigned to the SQL statement requested to be registered. Process 4
Although 4 is the execution of the registered SQL statement, the host variable value for the corresponding SQL statement is set in the SQL information table 6 also at this timing. The process 51 is a process for calling the SQL information acquisition unit 7 from the user execution program 1 when an SQL execution error occurs in the user execution program 1. The process 52 is the SQL corresponding to the SQL registration information specified by the current table 5 or the user when the SQL execution error held in the SQL information table 6 occurs.
Replaces the host variable value in the statement with the host variable '?' In the SQL statement and returns the SQL statement and host variable value information to the user.

【0016】(発明の第2の実施の形態)次に本発明の
第2の実施の形態について図3を参照すると、本実施の
形態はユーザ実行プログラム61において、ソースプロ
グラム72が、SQL登録関数81、SQL実行関数82、お
よび、SQLエラー情報取得関数83を持つ場合の例であ
る。SQL登録関数81、SQL実行関数82、および、SQL
エラー情報取得関数83はそれぞれローカル変数を持っ
ている。通常のプログラミング言語においては、関数間
において、互いのローカル変数を参照することはでき
ず、ユーザがSQL情報を管理する場合、これらグローバ
ルな変数として管理しなければならない。これはユーザ
のアプリケーション設計の段階から考慮する必要がある
など、著しく生産性を低下させることになる。本実施の
形態は、このようなケースでも、SQL登録関数81とSQL
実行関数82とSQLエラー情報取得関数83とがホスト
変数を保持するSQL文を用いることにより、ユーザが管
理すべき変数が、ローカル変数やグローバル変数と意識
することなく利用することができ、また、プログラム変
更も容易であるなど、プログラムの生産性および保守性
を向上させることが可能となる。
(Second Embodiment of the Invention) Next, referring to FIG. 3 for the second embodiment of the present invention, in this embodiment, in the user execution program 61, the source program 72 is the SQL registration function. This is an example in the case of having 81, SQL execution function 82, and SQL error information acquisition function 83. SQL registration function 81, SQL execution function 82, and SQL
Each of the error information acquisition functions 83 has a local variable. In a normal programming language, mutual local variables cannot be referenced between functions, and when a user manages SQL information, they must be managed as these global variables. This significantly reduces the productivity because it must be considered from the user's application design stage. In the present embodiment, even in such a case, the SQL registration function 81 and the SQL
By using the SQL statement in which the execution function 82 and the SQL error information acquisition function 83 hold the host variable, the variable that the user should manage can be used without being conscious of the local variable or the global variable, and It is possible to improve the productivity and maintainability of the program because the program can be easily changed.

【0017】[0017]

【発明の効果】以上説明したように本発明によれば、ユ
ーザが対象DBMSを意識することなく、SQL実行エラーの
デバッグを行うことができるという効果がある。また、
本来、登録したSQL情報は、プログラムを作成するユー
ザ自身が意識して管理すべき情報であるが、本発明によ
り、既に作成されているユーザ実行プログラムに大きな
変更を加えることなくSQL実行エラーのデバッグを行う
ことができるという効果がある。これにより、ユーザが
SQL実行エラーのデバッグを行う際の工数の大幅な削減
が可能となるという効果がある。
As described above, according to the present invention, the user can debug an SQL execution error without being aware of the target DBMS. Also,
Originally, the registered SQL information is the information that the user who creates the program should be aware of and manage, but according to the present invention, the SQL execution error debugging without making a large change to the already created user execution program. There is an effect that can be done. This allows the user
This has the effect of significantly reducing the man-hours required for debugging SQL execution errors.

【0018】また、ソースプログラムが、SQL登録関
数、SQL実行関数、および、SQLエラー情報取得関数持つ
場合、ホスト変数を保持するSQL文を用いることによ
り、ユーザが管理すべき変数が、ローカル変数やグロー
バル変数と意識することなく利用することができ、ま
た、プログラム変更も容易であるなど、プログラムの生
産性および保守性を向上させることが可能となるという
効果がある。
When the source program has a SQL registration function, a SQL execution function, and a SQL error information acquisition function, the variables to be managed by the user are local variables and It can be used without being considered as a global variable, and the program can be easily changed. Therefore, it is possible to improve the productivity and maintainability of the program.

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

【図1】本発明の第1の実施の形態の構成を示す図であ
る。
FIG. 1 is a diagram showing a configuration of a first exemplary embodiment of the present invention.

【図2】本発明の第1の実施の形態の動作を示す図であ
る。
FIG. 2 is a diagram showing an operation of the first exemplary embodiment of the present invention.

【図3】本発明の第2の実施の形態の構成を示す図であ
る。
FIG. 3 is a diagram showing a configuration of a second exemplary embodiment of the present invention.

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

1、61 ユーザ実行プログラム 2、62 実行環境 3、63 データベースアクセス共通ライブラリ 4、64 データベースアクセス共通処理部 5、65 カレントテーブル 6、66 SQL情報テーブル 7、67 SQL情報取得部 8、68 A社製DBMS用固有処理(データベースアク
セス)ライブラリ 9、69 B社製DBMS用固有処理(データベースアク
セス)ライブラリ 10、70 A社製DBMS 11、71 B社製DBMS 12、72 ソースプログラム
1, 61 User execution program 2, 62 Execution environment 3, 63 Database access common library 4, 64 Database access common processing unit 5, 65 Current table 6, 66 SQL information table 7, 67 SQL information acquisition unit 8, 68 A company DBMS specific processing (database access) library 9,69 Company B DBMS specific processing (database access) library 10,70 Company A DBMS 11,71 Company B DBMS 12,72 Source program

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 第1のDBMSと、該第1のDBMSと異種の第
2のDBMSと、 前記第1及び第2のDBMSをアクセスするユーザ実行プロ
グラムと、 該ユーザ実行プログラムを実行するために必要な実行環
境とを備え、 前記ユーザ実行プログラムは、ユーザが定義したソース
プログラムをコンパイルすることで生成され、 前記実行環境は、 第1のDBMS用固有処理(データベースアクセス)ライブ
ラリと、 第2のDBMS用固有処理(データベースアクセス)ライブ
ラリと、 前記ユーザ実行プログラムからのデータベースアクセス
要求により使用する前記第1又は第2のDBMS用固有処理
(データベースアクセス)ライブラリを切り分けるデー
タベースアクセス共通ライブラリとを備え、 該データベースアクセス共通ライブラリは、 データベースアクセス共通処理部と、複数のSQL情報テ
ーブルと、SQL情報取得部とを備え、 前記データベースアクセス共通処理部は、最後に実行さ
れたSQL文およびホスト変数値の情報を記憶するカレン
トテーブルを備え、 前記ソースプログラムは、ホスト変数を保持する2種類
のSQL文を用いDBMSにアクセスし、 前記データベースアクセス共通ライブラリは、前記ユー
ザ実行プログラムにおいて、SQL文の実行時、および、S
QL文に対するホスト変数の割り当て時のそれぞれにおい
て、SQL文およびホスト変数値の情報を前記SQL情報テー
ブルの対応する領域に保持し、 前記ユーザ実行プログラムにおいて、SQL実行エラーが
発生した場合、前記ユーザ実行プログラムのエラー処理
部から前記SQL情報取得部が呼び出され、前記ユーザ実
行プログラムにおいてエラーが発生した時点の前記カレ
ントテーブル、又は、ユーザが指定するSQL登録情報に
対応するSQL文及びホスト変数値の情報を前記SQL情報テ
ーブルから取得し、前記ユーザ実行プログラムに返却す
る、異種データベースシステムSQLデバッグシステム。
1. A first DBMS, a second DBMS different from the first DBMS, a user execution program for accessing the first and second DBMSs, and a user execution program for executing the user execution program. And a necessary execution environment, the user execution program is generated by compiling a source program defined by a user, and the execution environment includes a first DBMS-specific processing (database access) library and a second DBMS A unique processing (database access) library for DBMS and a database access common library for separating the first or second unique processing (database access) library for DBMS used by a database access request from the user execution program, The database access common library consists of the database access common processing part and A plurality of SQL information tables and a SQL information acquisition unit, the database access common processing unit includes a current table that stores information about the last executed SQL statement and host variable value, and the source program is a host The DBMS is accessed by using two types of SQL statements that hold variables, and the database access common library uses the user execution program to execute SQL statements and S
When assigning a host variable to a QL statement, the information of the SQL statement and the host variable value is held in the corresponding area of the SQL information table, and when an SQL execution error occurs in the user execution program, the user execution The SQL information acquisition unit is called from the error processing unit of the program, and the current table at the time when an error occurs in the user execution program, or the SQL statement and host variable value information corresponding to the SQL registration information specified by the user A heterogeneous database system SQL debug system that obtains a SQL statement from the SQL information table and returns it to the user execution program.
【請求項2】 前記ソースプログラムは、ホスト変数を
保持するSQL文を用いるSQL登録関数とSQL実行関数とSQL
エラー情報取得関数とを有する、請求項1に記載の異種
データベースシステムSQLデバッグシステム。
2. The source program is an SQL registration function, an SQL execution function, and an SQL that use an SQL statement that holds a host variable.
The heterogeneous database system SQL debug system according to claim 1, further comprising an error information acquisition function.
【請求項3】 請求項1又は請求項2に記載の異種デー
タベースシステムSQLデバッグシステムを用いた異種デ
ータベースシステムSQLデバッグ方法であって、 ユーザ実行プログラムからDBMSに対するSQL文登録要求
を受ける第1のステップと、 登録要求されるSQL文にホスト変数が存在するかを判断
する第2のステップと、 該第2のステップにて、登録要求される前記SQL文にホ
スト変数が存在する場合に、SQL情報テーブルを確保
し、前記SQL文の記憶およびホスト変数値の初期化の準
備を行い第4のステップへ進む第3のステップと、 該第2のステップにて、登録要求される前記SQL文にホ
スト変数が存在しない場合に、登録要求される前記SQL
文に対するホスト変数の割り当てが実行された場合、前
記SQL文及びホスト変数値をSQL情報テーブルに設定する
第4のステップと、 登録されたSQL文を実行し、対応するSQL文に対するホス
ト変数値を前記SQL情報テーブルに設定する第5のステ
ップと、 前記ユーザ実行プログラムにおいて、SQL実行エラーが
発生した際、前記ユーザ実行プログラムからSQL情報取
得部を呼び出す第6のステップと、 前記SQL情報テーブルで保持しているSQL実行エラーが発
生した時点のカレントテーブル又はユーザが指定するSQ
L登録情報に対応するSQL文のホスト変数値をSQL文中の
ホスト変数値と置き換え、該SQL文及びホスト変数値の
情報をユーザに返却する第7のステップとを有する、異
種データベースシステムSQLデバッグ方法。
3. A heterogeneous database system SQL debug method using the heterogeneous database system SQL debug system according to claim 1, wherein the first step is to receive a SQL statement registration request for a DBMS from a user execution program. And a second step of determining whether a host variable exists in the SQL statement requested to be registered, and in the second step, if there is a host variable in the SQL statement requested to be registered, the SQL information A table is secured, the storage of the SQL statement and the preparation of initialization of the host variable value are performed, and the third step proceeds to the fourth step; and in the second step, the host is added to the SQL statement requested to be registered. The SQL requested to be registered if the variable does not exist
When the host variable is assigned to the statement, the fourth step of setting the SQL statement and the host variable value in the SQL information table and the registered SQL statement are executed, and the host variable value for the corresponding SQL statement is set. A fifth step of setting in the SQL information table; a sixth step of calling an SQL information acquisition unit from the user execution program when an SQL execution error occurs in the user execution program; SQ specified by the current table or user when the SQL execution error occurs
L heterogeneous database system SQL debugging method, including a seventh step of replacing the host variable value of the SQL statement corresponding to the registration information with the host variable value in the SQL statement, and returning the information of the SQL statement and the host variable value to the user .
JP2001339265A 2001-11-05 2001-11-05 Heterogeneous database system SQL debugging method and system Expired - Fee Related JP3695528B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001339265A JP3695528B2 (en) 2001-11-05 2001-11-05 Heterogeneous database system SQL debugging method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001339265A JP3695528B2 (en) 2001-11-05 2001-11-05 Heterogeneous database system SQL debugging method and system

Publications (2)

Publication Number Publication Date
JP2003140922A true JP2003140922A (en) 2003-05-16
JP3695528B2 JP3695528B2 (en) 2005-09-14

Family

ID=19153640

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001339265A Expired - Fee Related JP3695528B2 (en) 2001-11-05 2001-11-05 Heterogeneous database system SQL debugging method and system

Country Status (1)

Country Link
JP (1) JP3695528B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005071547A1 (en) * 2004-01-22 2005-08-04 Hewlett-Packard Development Company, L.P. Data operating device and its method
KR100906449B1 (en) 2009-03-11 2009-07-08 주식회사 신시웨이 Database tool identifying apparatus and method thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04195640A (en) * 1990-11-28 1992-07-15 Nippon Telegr & Teleph Corp <Ntt> Program testing method
JPH0667867A (en) * 1992-06-15 1994-03-11 Fuji Xerox Co Ltd Data base accessing system for application program
JPH0765032A (en) * 1993-08-27 1995-03-10 Toshiba Corp Information processing system having data base language converting function
JP2002132555A (en) * 2000-10-19 2002-05-10 Nec Corp System, method and record medium of database access

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04195640A (en) * 1990-11-28 1992-07-15 Nippon Telegr & Teleph Corp <Ntt> Program testing method
JPH0667867A (en) * 1992-06-15 1994-03-11 Fuji Xerox Co Ltd Data base accessing system for application program
JPH0765032A (en) * 1993-08-27 1995-03-10 Toshiba Corp Information processing system having data base language converting function
JP2002132555A (en) * 2000-10-19 2002-05-10 Nec Corp System, method and record medium of database access

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005071547A1 (en) * 2004-01-22 2005-08-04 Hewlett-Packard Development Company, L.P. Data operating device and its method
KR100906449B1 (en) 2009-03-11 2009-07-08 주식회사 신시웨이 Database tool identifying apparatus and method thereof

Also Published As

Publication number Publication date
JP3695528B2 (en) 2005-09-14

Similar Documents

Publication Publication Date Title
US8566810B2 (en) Using database knowledge to optimize a computer program
US7992141B2 (en) Method and apparatus for building executable computer programs using compiled program libraries
US7194475B2 (en) Method, system, and program for performing an impact analysis of program statements in at least one source code file
US6889227B1 (en) Database access bridge system and process
JPH04320533A (en) Device and method for processing program
JPS62164136A (en) Data base access control system
US20070156736A1 (en) Method and apparatus for automatically detecting a latent referential integrity relationship between different tables of a database
JP2003323324A (en) Dynamic end user specific customization of application&#39;s physical data layer through data repository abstraction layer
JPH0644128A (en) Data base management system and method supporting object directional programming
CN112988782B (en) Hive-supported interactive query method and device and storage medium
US20030221187A1 (en) Database breakpoint apparatus and method
US7711740B2 (en) Data access layer design and code generation
JPH0667867A (en) Data base accessing system for application program
CN113204571A (en) SQL execution method and device related to write-in operation and storage medium
US6980995B2 (en) Method, computer program product, and system for automatically generating a hierarchial database schema report to facilitate writing application code for accessing hierarchial databases
US20040193567A1 (en) Apparatus and method for using a predefined database operation as a data source for a different database operation
US8434055B2 (en) Apparatus, system, and method for hiding advanced XML schema properties in EMF objects
US20060130034A1 (en) Apparatus, system, and method for providing access to a set of resources available directly to a particular class loader
WO2006126990A1 (en) Pattern query language
JP3695528B2 (en) Heterogeneous database system SQL debugging method and system
CN107622070B (en) Database management method and device
CN114547083A (en) Data processing method and device and electronic equipment
CN111723104A (en) Method, device and system for syntax analysis in data processing system
JP2001527241A (en) Method and apparatus for loading stored procedures in a database corresponding to object-oriented data dependencies
US11947931B2 (en) Generic factory class

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20041202

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20041202

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050309

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050509

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050608

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050621

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090708

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100708

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110708

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees