JPH10161914A - Automatic generating method for embedded sql - Google Patents

Automatic generating method for embedded sql

Info

Publication number
JPH10161914A
JPH10161914A JP8323796A JP32379696A JPH10161914A JP H10161914 A JPH10161914 A JP H10161914A JP 8323796 A JP8323796 A JP 8323796A JP 32379696 A JP32379696 A JP 32379696A JP H10161914 A JPH10161914 A JP H10161914A
Authority
JP
Japan
Prior art keywords
data
data item
program
definition
item
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
JP8323796A
Other languages
Japanese (ja)
Inventor
Shinji Tanaka
真二 田中
Mitsunori Matsufuji
光範 松藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Software Engineering Co Ltd
Hitachi Ltd
Original Assignee
Hitachi Software Engineering Co Ltd
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Software Engineering Co Ltd, Hitachi Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP8323796A priority Critical patent/JPH10161914A/en
Publication of JPH10161914A publication Critical patent/JPH10161914A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To efficiently prepare a program for accessing a relational database by automatically generating an embedded SQL to be used for performing access from a program described in COBOL language or C language to the relational data base. SOLUTION: In a data item dictionary 11, data names and attributes more than one corresponding to the programming language are defined for one data item and by linking these data items, data are related. In a table definition file 12, a table name and the most significant item in the data item dictionary 11 are selected. In data definition 13, the table definition to be used is selected according to a template description language described on a template 14. The common description in the template 14 can be described as components 15. A program source containing the embedded SQL is outputted to a program source 17.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラムの自動
生成に関し、特に、埋め込み型SQLを自動生成する部
品を作成できる機能を備え、プログラム開発者は、この
機能を利用してリレーショナルデータベースのアクセス
部品の作成を容易に行い得て、リレーショナルデータベ
ースにアクセスするプログラムの作成を効率良く行える
ようにしたプログラム自動生成方法に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to automatic generation of a program, and more particularly, to a program developer having a function capable of creating a part for automatically generating an embedded SQL. The present invention relates to an automatic program generation method that can easily create a program and efficiently create a program that accesses a relational database.

【0002】[0002]

【従来の技術】従来、プログラムの自動生成において、
リレーショナルデータベースにアクセスするプログラム
を生成しようとする場合、ソースプログラム中のリレー
ショナルデータベースの使用宣言から、基本ロジックを
構成するスケルトンを合成して目的プログラムを生成す
る、特開平5―61659号広報に記載されている集計
処理プログラムの自動生成方法がある。
2. Description of the Related Art Conventionally, in automatic generation of a program,
When a program for accessing a relational database is to be generated, a target program is generated by synthesizing a skeleton constituting basic logic from a declaration of use of a relational database in a source program, which is described in JP-A-5-61659. There is an automatic generation method of the aggregation processing program.

【0003】[0003]

【発明が解決しようとする課題】COBOL言語やC言
語で記述したプログラムからリレーショナルデータベー
スへアクセスする場合、埋め込み型SQLが使用でき
る。埋め込み型SQLを生成する部品を作成しようとす
ると、次のような問題が発生する。すなわち、1.表を
構成する列名を取得し生成する方法がない2.列データ
を格納する埋め込み変数名を取得し生成する方法がな
い。
When a relational database is accessed from a program written in COBOL language or C language, embedded SQL can be used. When attempting to create a component for generating an embedded SQL, the following problem occurs. That is, 1. 1. There is no way to acquire and generate column names that make up a table. There is no way to get and generate the embedded variable name that stores the column data.

【0004】3.埋め込み変数の定義を取得し生成する
方法がない。
[0004] 3. There is no way to get and generate embedded variable definitions.

【0005】[0005]

【課題を解決するための手段】埋め込み型SQLでは、
表を構成する列名と列データを格納する埋め込み変数名
が必要であり、さらに、埋め込み変数の定義が必要であ
る。本発明では、列名、埋め込み変数名及び埋め込み変
数の定義をプログラム生成時に展開する機能を提供する
ことで、埋め込み型SQLの自動生成を可能にすること
である。
SUMMARY OF THE INVENTION In embedded SQL,
A column name constituting the table and an embedded variable name for storing column data are required, and furthermore, an embedded variable definition is required. In the present invention, it is possible to automatically generate an embedded SQL by providing a function of expanding a column name, an embedded variable name and a definition of an embedded variable at the time of generating a program.

【0006】[0006]

【発明の実施の形態】以下、本発明の実施の形態を図面
を用して具体的に説明する。図1は本発明にかかるプロ
グラム開発支援システムの構成を示す機能構成図であ
る。図1において11はデータ項目辞書、12は表定義
ファイル、13プログラム定義、14はテンプレート、
15は部品、16は表示装置、17は生成プログラムソ
ースである。データ項目辞書11には、1つのデータ項
目に対して1つ以上のプログラミング言語に対応したデ
ータ名と属性が定義でき、そのデータ項目とデータ項目
を結合することでデータを関連付けることができる。表
定義ファイル12には、表名とデータ項目辞書11の最
上位項目が選択できる。プログラム定義13では、テン
プレート14に記述されたテンプレート記述言語に従い
使用する表定義の選択を行う。テンプレート内の共通的
な記述は部品15として記述することができる。表示装
置16にはプログラム定義で使用する表定義を選択する
画面が表示される。プログラムソース17には、埋め込
み型SQLを含むプログラムソースが出力される。
Embodiments of the present invention will be specifically described below with reference to the drawings. FIG. 1 is a functional configuration diagram showing a configuration of a program development support system according to the present invention. In FIG. 1, 11 is a data item dictionary, 12 is a table definition file, 13 is a program definition, 14 is a template,
Reference numeral 15 denotes a component, 16 denotes a display device, and 17 denotes a generation program source. In the data item dictionary 11, data names and attributes corresponding to one or more programming languages can be defined for one data item, and data can be associated by combining the data item with the data item. In the table definition file 12, the table name and the top item of the data item dictionary 11 can be selected. In the program definition 13, a table definition to be used is selected according to the template description language described in the template 14. The common description in the template can be described as a component 15. The display device 16 displays a screen for selecting a table definition used in the program definition. A program source including an embedded SQL is output to the program source 17.

【0007】図2は、データ項目辞書での、固定長文字
型と可変長文字型の列からなる表についてのデータ項目
の結合例である。21、22、23、24、25は各々
1つのデータ項目であり、長方形の左上、右上、左下及
び右下の文字列はそれぞれ表の列名、表の列のデータ
型、プログラミング言語のデータ名及びプログラミング
言語のデータの属性である。
FIG. 2 shows an example of combining data items in a table composed of fixed-length character type and variable-length character type columns in a data item dictionary. 21, 22, 23, 24, 25 are each one data item, and the upper left, upper right, lower left, and lower right character strings of the rectangle are the column name of the table, the data type of the column of the table, and the data name of the programming language, respectively. And programming language data attributes.

【0008】図3に列名を取得する処理の流れを示す。
まず、ステップ31において、表定義に指定されている
最上位項目の取り出し処理を行う。次に、ステップ32
において、階層1の最初のデータ項目の取り出し処理を
行う。次に、ステップ33でデータ項目が有るか判定す
る。ステップ34において、データ項目から表の列名の
取得処理を行う。次に、ステップ35において階層1の
次のデータ項目の取り出し処理を行う。
FIG. 3 shows a flow of processing for acquiring a column name.
First, in step 31, a process of extracting the top item specified in the table definition is performed. Next, step 32
, The first data item of the first layer is taken out. Next, in step 33, it is determined whether there is a data item. In step 34, a process of acquiring the column names of the table from the data items is performed. Next, in step 35, a process of taking out the next data item of the hierarchy 1 is performed.

【0009】図4に埋め込み変数名を取得する処理の流
れを示す。まず、ステップ41において、表定義に指定
されている最上位項目の取り出し処理を行う。次に、ス
テップ42において、階層1の最初のデータ項目の取り
出し処理を行う。次に、ステップ43でデータ項目が有
るか判定する。ステップ44において、データ項目から
プログラミング言語のデータ名の取得処理を行う。次
に、ステップ45において階層1の次のデータ項目の取
り出し処理を行う。
FIG. 4 shows a flow of processing for acquiring an embedded variable name. First, in step 41, a process of extracting the top item specified in the table definition is performed. Next, in step 42, a process of extracting the first data item of the hierarchy 1 is performed. Next, in step 43, it is determined whether there is a data item. In step 44, a process of acquiring the data name of the programming language from the data item is performed. Next, in step 45, a process of taking out the next data item of the hierarchy 1 is performed.

【0010】図5に埋め込み変数名の定義作成処理の流
れを示す。まず、ステップ501において、表定義に指
定されている最上位項目の取り出し処理を行う。次に、
ステップ502において、階層1の最初のデータ項目の
取り出し処理を行う。次に、ステップ503で階層1の
データ項目が有るか判定する。ステップ504におい
て、データ項目のプログラミング言語のデータ名と属性
の取得処理を行う。次に、ステップ505においてデー
タ定義文の組み立て処理を行う。次に、ステップ506
において、階層2の先頭データ項目の取り出し処理を行
う。次に、ステップ507において、階層2のデータが
有るか判定する。ステップ508において、データ項目
のプログラミング言語のデータ名と属性の取り出し処理
を行う。次に、ステップ509においてデータ定義文の
組み立て処理を行う。次に、ステップ510において、
階層2の次のデータ項目の取り出し処理を行う。ステッ
プ507で階層2のデータが無い場合は、ステップ51
1において、階層2の次のデータ項目の取り出し処理を
行う。
FIG. 5 shows a flow of a process of creating a definition of an embedded variable name. First, in step 501, a process of extracting the top item specified in the table definition is performed. next,
In step 502, a process of extracting the first data item of the hierarchy 1 is performed. Next, in step 503, it is determined whether or not there is a data item of the first tier. In step 504, a process of acquiring the data name and attribute of the programming language of the data item is performed. Next, in step 505, a data definition statement assembling process is performed. Next, step 506
In step 2, the process of extracting the first data item of layer 2 is performed. Next, in step 507, it is determined whether or not there is data of layer 2. In step 508, a process of extracting the data name and the attribute of the programming language of the data item is performed. Next, in step 509, a data definition statement assembling process is performed. Next, in step 510,
The next data item of the hierarchy 2 is fetched. If there is no data of layer 2 in step 507, step 51
In step 1, the next data item of layer 2 is fetched.

【0011】[0011]

【発明の効果】以上に説明したように、本発明のプログ
ラム自動生成方法によれば、以下のような利点がある。
As described above, the program automatic generation method of the present invention has the following advantages.

【0012】1.リレーショナルデータベースのアクセ
ス部品が作成できるようになり、プログラム開発の効率
化、省力化を図ることができる。
1. Access components of the relational database can be created, and program development can be made more efficient and labor-saving.

【0013】2.リレーショナルデータベースのアクセ
ス部品を使用することにより、開発するプログラムの高
品質化を図ることができる。
2. By using the access components of the relational database, the quality of the program to be developed can be improved.

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

【図1】本発明に一実施例にかかるプログラム開発支援
システムの構成を示す機能構成図である。
FIG. 1 is a functional configuration diagram illustrating a configuration of a program development support system according to an embodiment of the present invention.

【図2】データ項目辞書でのデータの構成図である。FIG. 2 is a configuration diagram of data in a data item dictionary.

【図3】列名取得のフローチャートである。FIG. 3 is a flowchart of column name acquisition.

【図4】埋め込み変数名取得のフローチャートである。FIG. 4 is a flowchart of acquiring an embedded variable name.

【図5】埋め込み変数定義作成のフローチャートであ
る。
FIG. 5 is a flowchart of creating an embedded variable definition.

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

11 データ項目辞書 12 表定義ファイル 13 プログラム定義 14 プロプラム生成 15 テンプレート 16 部品 17 生成するプログラムソース 21 最上位のデータ項目 22 最上位データ項目に1番目に結合する階層1のデ
ータ項目 23 最上位データ項目に2番目に結合する階層1のデ
ータ項目 24 23のデータ項目に1番目に結合する階層2のデ
ータ項目 25 23のデータ項目に2番目に結合する階層2のデ
ータ項目 31 表定義からの最上位項目の取得処理 32 階層1の最初のデータの取得処理 33 階層1のデータ項目有無判定 34 データ項目の表の列名取得処理 35 同じ階層の次データ項目取得処理 41 表定義からの最上位項目の取得処理 42 階層1の最初のデータの取得処理 43 階層1のデータ項目有無判定 44 データ項目のプログラミング言語のデータ名の取
得処理 45 同じ階層の次データ項目取得処理 501 表定義からの最上位項目の取得処理 502 階層1の先頭データ項目の取得処理 503 階層1のデータ項目有無判定 504 データ項目のプログラミング言語のデータ名の
取得処理 505 データ定義文の組み立て処理 506 階層2の先頭のデータ項目の取得処理 507 階層2のデータ項目有無判定 508 データ項目のプログラミング言語のデータ名の
取得処理 509 データ定義文の組み立て処理 510 階層1の次データ項目取得処理 511 階層2の次データ項目取得処理
11 data item dictionary 12 table definition file 13 program definition 14 program generation 15 template 16 parts 17 program source to be generated 21 top-level data item 22 data item of hierarchy 1 which is connected first to top-level data item 23 top-level data item The data item of the hierarchy 1 which is connected secondly to the data item of the hierarchy 23 The data item of the hierarchy 2 which is secondly connected to the data item of the hierarchy 25 Acquisition process of item 32 Acquisition process of the first data of hierarchy 1 33 Data item existence determination of hierarchy 1 34 Acquisition process of column name of table of data item 35 Acquisition process of next data item of same hierarchy 41 of top item from table definition Acquisition processing 42 Acquisition processing of the first data of layer 1 43 Data item existence determination of layer 1 44 Acquisition process of data name of programming language of data item 45 Acquisition process of next data item of the same hierarchy 501 Acquisition process of top item from table definition 502 Acquisition process of top data item of hierarchy 1 503 Judgment of existence of data item of hierarchy 1 504 Acquisition processing of data name of programming language of data item 505 Assembly processing of data definition statement 506 Acquisition processing of first data item of hierarchy 2 507 Judgment of existence of data item of hierarchy 2 508 Acquisition processing of data name of programming language of data item 509 Data definition statement assembling process 510 Tier 1 next data item acquisition process 511 Tier 2 next data item acquisition process

フロントページの続き (72)発明者 松藤 光範 神奈川県横浜市中区尾上町6丁目81番地 日立ソフトウェアエンジニアリング株式会 社内Continued on the front page (72) Inventor Mitsunori Matsufuji 6-81 Onoecho, Naka-ku, Yokohama-shi, Kanagawa Prefecture Hitachi Software Engineering Co., Ltd.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】埋め込み型SQLを生成するための部品を
容易に作成するために、階層化されたデータ項目辞書か
ら、表を構成する列名を取得する機能と、表を構成する
列のデータを格納する埋め込み変数名を取得する機能
と、表を構成する列のデータを格納する埋め込み変数の
定義を取得する機能を具備することを特徴とする、プロ
グラムの生成方法。
1. A function for acquiring a column name constituting a table from a hierarchical data item dictionary, in order to easily create a part for generating an embedded SQL, and a data of a column constituting a table. And a function for acquiring a definition of an embedded variable for storing data of a column constituting a table.
JP8323796A 1996-12-04 1996-12-04 Automatic generating method for embedded sql Pending JPH10161914A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8323796A JPH10161914A (en) 1996-12-04 1996-12-04 Automatic generating method for embedded sql

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8323796A JPH10161914A (en) 1996-12-04 1996-12-04 Automatic generating method for embedded sql

Publications (1)

Publication Number Publication Date
JPH10161914A true JPH10161914A (en) 1998-06-19

Family

ID=18158717

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8323796A Pending JPH10161914A (en) 1996-12-04 1996-12-04 Automatic generating method for embedded sql

Country Status (1)

Country Link
JP (1) JPH10161914A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001040919A1 (en) * 1999-12-02 2001-06-07 Lockheed Martin Corporation Method and system for importing database information
JP2002366401A (en) * 2001-06-06 2002-12-20 Nippon Yunishisu Kk Integral data mart structure, and operation supporting system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6424358B1 (en) 1998-12-03 2002-07-23 Lockheed Martin Corporation Method and system for importing database information
WO2001040919A1 (en) * 1999-12-02 2001-06-07 Lockheed Martin Corporation Method and system for importing database information
JP2002366401A (en) * 2001-06-06 2002-12-20 Nippon Yunishisu Kk Integral data mart structure, and operation supporting system

Similar Documents

Publication Publication Date Title
US6581062B1 (en) Method and apparatus for storing semi-structured data in a structured manner
US6449620B1 (en) Method and apparatus for generating information pages using semi-structured data stored in a structured manner
US6446075B1 (en) System and method for automatically synchronizing different classes of databases utilizing a repository database
US20080288242A1 (en) System And Method Of Presentation of Multilingual Metadata
JP2000090098A (en) Data base querying method, its implementing device, and medium recording processing program thereof
CN101788994A (en) Method for constructing data display model and method and device for displaying data
US10509632B2 (en) Model augmentation in a model-driven application development environment
JPH07319918A (en) Device for specifying retrieving object in document
US20060015483A1 (en) SQL query enhancement technique
JPH11232090A (en) Automatic data base generation system
CN109948133B (en) Data form realization method based on Layu
JP2003248635A (en) Database accessing method and system in management information base of network management protocol
JPH10161914A (en) Automatic generating method for embedded sql
US6282545B1 (en) Mechanism for information extraction and traversal from an object base including a plurality of object classes
CN112948529A (en) Dynamic text reading and writing method and device, electronic equipment and medium
JPH1091494A (en) Method and device for converting data base operation program
JP2000181697A (en) Method and device for conversion to open type system of mainframe cobol property and recording medium
KR100873808B1 (en) How to Integrate Data Using Metadata in Multiple Database Middleware Systems
JP2942414B2 (en) Virtual database method
US20060048126A1 (en) Method and a system thereof for generating a homepage content file capable of dynamically linking with a plurality of on-demand knowledge bases
JPH0736737A (en) Method for generating test data
JPH05135054A (en) Document processing method
JPS6351291B2 (en)
CN115098531A (en) Fuzzy query interface generation method, device and equipment
CN116955393A (en) Data processing method and device, electronic equipment and storage medium