JP4343613B2 - Form creation device, program - Google Patents

Form creation device, program Download PDF

Info

Publication number
JP4343613B2
JP4343613B2 JP2003278287A JP2003278287A JP4343613B2 JP 4343613 B2 JP4343613 B2 JP 4343613B2 JP 2003278287 A JP2003278287 A JP 2003278287A JP 2003278287 A JP2003278287 A JP 2003278287A JP 4343613 B2 JP4343613 B2 JP 4343613B2
Authority
JP
Japan
Prior art keywords
data
query
form part
extracted
extraction
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.)
Expired - Fee Related
Application number
JP2003278287A
Other languages
Japanese (ja)
Other versions
JP2005044175A (en
Inventor
敬一 高島
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2003278287A priority Critical patent/JP4343613B2/en
Publication of JP2005044175A publication Critical patent/JP2005044175A/en
Application granted granted Critical
Publication of JP4343613B2 publication Critical patent/JP4343613B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Description

本発明は、データベース装置およびデータベースファイル(以下、まとめてデータベース)からデータを抽出し、あらかじめ定義されたフィールド定義に従って、抽出結果をフィールドデータとして流し込んで帳票を作成する、帳票作成方法、帳票作成装置、コンピュータ実行可能な帳票作成プログラムに関するものである。   The present invention relates to a form creation method and a form creation apparatus that extract data from a database device and a database file (hereinafter collectively referred to as a database) and create a form by flowing the extraction result as field data in accordance with a predefined field definition. The present invention relates to a computer-executable form creation program.

従来、フィールドデータを取得し、当該取得されたフィールドデータをフォームに配置することによって、所望の帳票を作成する帳票作成システム(例えば、特許文献1参照)があった。
特開2000−222494
Conventionally, there has been a form creation system (see, for example, Patent Document 1) that obtains field data and places the obtained field data on a form to create a desired form.
JP2000-222494

本出願人は、帳票の1つの形態として、メインフォーム部分とサブフォーム部分とで構成されるような帳票を考えている。例えば、図12に示すような見積もり書は、注文番号ごとに商品名とその金額などを一覧にまとめた伝票であり、メインフォームには注文番号と顧客情報や注文日などのフィールドを有し、サブフォームには商品名と個数と単価と金額などを1行とした複数の明細行と金額の合計をした集計行のフィールドを有する帳票である。このようなメインフォームとサブフォームを持つ帳票を作成する場合、データベース(単独のテーブル、もしくは結合した複数のテーブル)から、1つのクエリに基づいて、メインフォームのフィールドに流し込むフィールドデータとサブフォームのフィールドに流し込むフィールドデータとが結合されたデータを抽出する。その抽出したデータに含まれる各フィールドデータをメインフォームのフィールドとサブフォームのフィールドに流し込む。   The present applicant considers a form composed of a main form part and a subform part as one form of the form. For example, a quote as shown in FIG. 12 is a slip in which product names and their amounts are listed for each order number, and the main form has fields such as order number, customer information, and order date. The subform is a form having a plurality of detail lines with a product name, number of pieces, unit price, amount of money, etc. as one line, and a total row field summing up the amounts. When creating a form with such a main form and subform, the field data and subform of the main form that are flowed into the fields of the main form based on one query from the database (single table or multiple tables combined) are created. Data that is combined with field data that flows into the field is extracted. Each field data contained in the extracted data is poured into the field of the main form and the field of the subform.

例えば、図13は、注文テーブル1301と注文明細テーブル1302との2つのテーブルを用いてフィールドデータを管理しているシステムである。ここでは、まず注文テーブル1301と注文明細テーブル1302から抽出対象のフィールドを結合して生成されたテーブル1304を取得し、該テーブル1304に基づいて注文No.ごとに明細を一覧にして帳票を作成する場合を説明した図である。この場合、テーブル1304に示したように、各レコードのメインフォームに対応するフィールドデータ(図13の「注文No」、「注文日」、「顧客名」)には同じ値が繰り返し入ることになってしまう。したがって、生成されたテーブルのデータ量が大きくなってしまい、一度に膨大なデータを抽出する場合やネットワーク経由でデータベース装置に接続している場合、帳票作成処理での必要メモリが大きくなったり、データベースからのデータ転送時間が長くなったりしてしまい、処理効率が悪くなってしまう。   For example, FIG. 13 shows a system that manages field data using two tables, an order table 1301 and an order detail table 1302. Here, first, a table 1304 generated by combining fields to be extracted from the order table 1301 and the order details table 1302 is obtained. It is a figure explaining the case where a report is created by listing details for each. In this case, as shown in the table 1304, the same value is repeatedly entered in the field data corresponding to the main form of each record ("Order No.", "Order Date", "Customer Name" in FIG. 13). End up. Therefore, the amount of data in the generated table becomes large, and if a large amount of data is extracted at once or connected to a database device via a network, the memory required for the form creation process increases, the database The data transfer time from the computer becomes long, and the processing efficiency deteriorates.

本発明は、上述の点に鑑みてなされたもので、メインフォームとサブフォームで別のクエリでデータを抽出することにより、抽出結果のデータ量を減らすようにすることを目的とする。   The present invention has been made in view of the above-described points, and an object of the present invention is to reduce the data amount of the extraction result by extracting data with different queries in the main form and the subform.

上記課題を解決するために、本願の帳票作成装置は、第1フォーム部分と第2フォーム部分とから構成される帳票に、データベースから抽出したデータを流し込んで帳票を作成する帳票作成装置であって、
前記第1フォーム部分に流し込む第1のデータの抽出条件を示す第1抽出条件と、前記第2フォーム部分に流し込む第2のデータの抽出条件を示す第2抽出条件とを設定する抽出条件設定手段と、
前記第1フォーム部分と前記第2フォーム部分とのそれぞれに対して別のクエリを用いてデータを抽出する別クエリ処理と、前記第1フォーム部分と前記第2フォーム部分との両方に対する単一のクエリを用いてデータを抽出する単一クエリ処理とを切り替える切替手段と、
前記第1抽出条件に基づいて第1フォーム部分のクエリを生成して実行することにより、複数のレコードを含む前記第1のデータを前記データベースから抽出する第1データ抽出手段と、
前記第1データ抽出手段で抽出された第1のデータに含まれるレコードの1つを帳票の第1フォーム部分に流し込み、当該第1フォーム部分に流し込まれた1つのレコードと前記第2抽出条件とを用いて第2フォーム部分のクエリを生成して実行することにより、前記第2のデータを前記データベースから抽出し、更に、当該1つのレコードが第1フォーム部分に流し込まれている帳票の第2フォーム部分に対して当該抽出した第2のデータを流し込むことによって帳票を作成する処理を実行する第1帳票作成手段と、
前記第1抽出条件と前記第2抽出条件とを合わせた1つのクエリを生成して実行することにより、前記第1フォーム部分と前記第2フォーム部分とに流し込む第3のデータを前記データベースから抽出する第3データ抽出手段と、
前記第3データ抽出手段で抽出した第3のデータを、前記第1フォーム部分と前記第2フォーム部分とに流し込んで帳票を作成する処理を実行する第2帳票作成手段とを有し、
前記切替手段で前記別クエリ処理に切り替えられた場合、前記第1データ抽出手段で前記第1のデータを抽出し、更に、当該抽出した前記第1のデータに含まれるレコードを1つずつ順番に用いて、当該第1のデータに含まれる全てのレコードを処理するまで前記第1帳票作成手段の処理を繰り返し実行し、
一方、前記切替手段で前記単一クエリ処理に切り替えられた場合、前記第3データ抽出手段で前記第3のデータを抽出し、更に、当該抽出した第3のデータを用いて、前記第2帳票作成手段の処理を実行することを特徴とする。
In order to solve the above problems, a form creation device of the present application is a form creation device that creates a form by pouring data extracted from a database into a form composed of a first form part and a second form part. ,
Extraction condition setting means for setting a first extraction condition indicating the extraction condition of the first data flowing into the first form portion and a second extraction condition indicating the extraction condition of the second data flowing into the second form portion. When,
A separate query process for extracting data using a separate query for each of the first form part and the second form part, and a single query for both the first form part and the second form part Switching means for switching between single query processing for extracting data using a query,
First data extraction means for extracting the first data including a plurality of records from the database by generating and executing a query of the first form part based on the first extraction condition;
One of the records included in the first data extracted by the first data extraction means is poured into the first form portion of the form, one record poured into the first form portion, the second extraction condition, The second data is extracted from the database by generating and executing the query of the second form part using the second, and the second of the form in which the one record is poured into the first form part. First form creation means for executing a process of creating a form by pouring the extracted second data into the form part;
By generating and executing one query that combines the first extraction condition and the second extraction condition, the third data that flows into the first form part and the second form part is extracted from the database. Third data extraction means for
Second form creation means for executing a process of creating a form by pouring the third data extracted by the third data extraction means into the first form portion and the second form portion;
When the switching means switches to the different query processing, the first data extraction means extracts the first data, and records in the extracted first data are sequentially sorted one by one. And repeatedly executing the processing of the first form creation means until all the records included in the first data are processed,
On the other hand, when the switching unit switches to the single query processing, the third data extraction unit extracts the third data, and further uses the extracted third data to extract the second form. The processing of the creating means is executed.

上記課題を解決するために、本願のプログラムは、コンピュータに、第1フォーム部分と第2フォーム部分とから構成される帳票に、データベース装置のデータベースから抽出したデータを流し込んで帳票を作成させるためのプログラムであって、
前記コンピュータを、
前記第1フォーム部分に流し込む第1のデータの抽出条件を示す第1抽出条件と、前記第2フォーム部分に流し込む第2のデータの抽出条件を示す第2抽出条件とを設定する抽出条件設定手段、
前記第1フォーム部分と前記第2フォーム部分とのそれぞれに対して別のクエリを用いてデータを抽出する別クエリ処理と、前記第1フォーム部分と前記第2フォーム部分との両方に対する単一のクエリを用いてデータを抽出する単一クエリ処理とを切り替える切替手段、
前記第1抽出条件に基づいて第1フォーム部分のクエリを生成して実行することにより、複数のレコードを含む前記第1のデータを前記データベースから抽出する第1データ抽出手段、
前記第1データ抽出手段で抽出された第1のデータに含まれるレコードの1つを帳票の第1フォーム部分に流し込み、当該第1フォーム部分に流し込まれた1つのレコードと前記第2抽出条件とを用いて第2フォーム部分のクエリを生成して実行することにより、前記第2のデータを前記データベースから抽出し、更に、当該1つのレコードが第1フォーム部分に流し込まれている帳票の第2フォーム部分に対して当該抽出した第2のデータを流し込むことによって帳票を作成する処理を実行する第1帳票作成手段、
前記第1抽出条件と前記第2抽出条件とを合わせた1つのクエリを生成して実行することにより、前記第1フォーム部分と前記第2フォーム部分とに流し込む第3のデータを前記データベースから抽出する第3データ抽出手段、
前記第3データ抽出手段で抽出した第3のデータを、前記第1フォーム部分と前記第2フォーム部分とに流し込んで帳票を作成する処理を実行する第2帳票作成手段、として機能させるためのプログラムであり、
更に、前記切替手段で前記別クエリ処理に切り替えられた場合、前記第1データ抽出手段で前記第1のデータを抽出し、更に、当該抽出した前記第1のデータに含まれるレコードを1つずつ順番に用いて、当該第1のデータに含まれる全てのレコードを処理するまで前記第1帳票作成手段の処理を繰り返し実行し、一方、前記切替手段で前記単一クエリ処理に切り替えられた場合、前記第3データ抽出手段で前記第3のデータを抽出し、更に、当該抽出した第3のデータを用いて、前記第2帳票作成手段の処理を実行するように、前記コンピュータを機能させることを特徴とする。
In order to solve the above problems, a program of the present application causes a computer to create a form by pouring data extracted from a database of a database device into a form composed of a first form part and a second form part. A program,
The computer,
Extraction condition setting means for setting a first extraction condition indicating the extraction condition of the first data flowing into the first form portion and a second extraction condition indicating the extraction condition of the second data flowing into the second form portion. ,
A separate query process for extracting data using a separate query for each of the first form part and the second form part, and a single query for both the first form part and the second form part Switching means for switching between single query processing for extracting data using a query,
First data extraction means for extracting the first data including a plurality of records from the database by generating and executing a query of the first form part based on the first extraction condition;
One of the records included in the first data extracted by the first data extraction means is poured into the first form portion of the form, one record poured into the first form portion, the second extraction condition, The second data is extracted from the database by generating and executing the query of the second form part using the second, and the second of the form in which the one record is poured into the first form part. First form creation means for executing a process of creating a form by flowing the extracted second data into the form part;
By generating and executing one query that combines the first extraction condition and the second extraction condition, the third data that flows into the first form part and the second form part is extracted from the database. Third data extraction means for
A program for causing the third data extracted by the third data extraction means to flow into the first form part and the second form part to function as second form creation means for executing a process for creating a form And
Further, when the switching means switches to the different query processing, the first data extracting means extracts the first data, and further records one by one in the extracted first data. When used in order, repeatedly execute the processing of the first form creation means until all records included in the first data are processed, while the switching means is switched to the single query processing, Extracting the third data by the third data extraction means, and further causing the computer to function so as to execute the processing of the second form creation means by using the extracted third data. Features.

本発明によれば、データベースからの抽出結果のデータ中にメインフォームのデータが繰り返し入ることがなくなり、抽出結果の全体的なデータ量が小さくなる。特に、1度に膨大なデータを抽出する場合やネットワーク経由でデータベース装置に接続している場合、帳票作成処理での必要メモリが小さくて済んだり、データベースからのデータ転送時間が最小限で済むという効果がある。   According to the present invention, the data of the main form is not repeatedly entered in the data of the extraction result from the database, and the overall data amount of the extraction result is reduced. In particular, if a large amount of data is extracted at once, or if it is connected to a database device via a network, the required memory for form creation processing can be reduced, and the time required to transfer data from the database can be minimized. effective.

また、別クエリ処理にすると抽出結果のデータ量は小さく出来るが、クエリ実行の回数が増えるので、別クエリ処理(複数クエリ処理)と単一クエリ処理とを切り替え可能とすることにより、使用可能メモリが大量にある場合やデータベースがローカル接続されている場合など、抽出結果のデータ量よりもクエリ回数の方が処理速度に大きく影響する環境に対しても対応することが出来るという効果がある。   In addition, if you use separate query processing, the amount of extracted data can be reduced, but the number of query executions increases, so you can switch between separate query processing (multiple query processing) and single query processing. There is an effect that it is possible to cope with an environment where the number of queries greatly affects the processing speed rather than the data amount of the extraction result, such as when there is a large amount of data or when the database is locally connected.

以下、本発明の一実施形態を図面を参照して説明する。   Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

図1は、本実施形態の帳票作成装置が属するシステム全体の構成を示す図である。本実施形態の帳票作成装置は、データベース装置とLANを介して接続されているものとするが、データベース装置との接続方法は、WANやローカル接続などその他の方法であってもよいし、帳票作成装置内にあるデータベースファイルであってもよい。   FIG. 1 is a diagram showing the configuration of the entire system to which the form creation device of this embodiment belongs. The form creation device of the present embodiment is assumed to be connected to the database device via the LAN, but the connection method with the database device may be other methods such as WAN or local connection, or form creation. It may be a database file in the device.

図2は、図1の帳票作成装置の基本的なハードウェア構成を示すブロック図である。本実施形態の帳票作成装置は、中央処理装置1、記憶装置2、表示装置3、キーボード4、マウス5、外部記憶装置6、印刷装置7などから構成されており、一般的なワークステーションやパーソナルコンピュータなどの情報処理装置にプログラムを導入することにより実現可能である。   FIG. 2 is a block diagram showing a basic hardware configuration of the form creation device of FIG. The form creation apparatus according to the present embodiment includes a central processing unit 1, a storage device 2, a display device 3, a keyboard 4, a mouse 5, an external storage device 6, a printing device 7, and the like. This can be realized by introducing a program into an information processing apparatus such as a computer.

なお、本発明を実現するためのコンピュータプログラムは、外部補助記憶装置6やネットワークなどを介して、コンピュータに配給されることが可能である。また、コンピュータプログラム等が格納される記憶媒体としては、ROM、フロッピー(登録商標)ディスク、CD−ROM、ハードディスク、メモリカード、光磁気ディスクなどを用いることが可能である。図6は、記憶媒体に格納された帳票作成プログラムの構成例を示す。また、図7は、帳票作成プログラム、DB接続情報、クエリ情報、フォームデータ、プログラムワークメモリが記憶装置2に格納され、プログラムが実行可能となった状態のメモリマップ例である。   The computer program for realizing the present invention can be distributed to computers via the external auxiliary storage device 6 or a network. As a storage medium for storing a computer program or the like, a ROM, a floppy (registered trademark) disk, a CD-ROM, a hard disk, a memory card, a magneto-optical disk, or the like can be used. FIG. 6 shows a configuration example of a form creation program stored in a storage medium. FIG. 7 is an example of a memory map in which the form creation program, DB connection information, query information, form data, and program work memory are stored in the storage device 2 and the program can be executed.

DB接続情報704(図8)は、帳票に流し込むフィールドデータが格納されたデータベースの場所を表すデータソース名、そのデータベースにアクセスするためのユーザ名とパスワードなどが格納されるものとする。   The DB connection information 704 (FIG. 8) stores a data source name indicating the location of the database in which the field data to be flowed into the form, a user name and a password for accessing the database, and the like are stored.

クエリ情報705は(図9)は、データベースから帳票に流し込むフィールドデータを抽出するためのSQL(クエリ)を生成するための情報で、メインフォームとサブフォームのクエリ設定、メインフォームとサブフォームで別のクエリでデータを抽出するかを表すフラグ、同じ値のレコードが連続した場合にそのレコードを削除する(抽出しない)かをあらわすフラグ、文字列の引用符の設定などを含んでいる。図10は、別クエリフラグ、重複レコード削除フラグ、引用符設定を行う画面の例である。   Query information 705 (FIG. 9) is information for generating an SQL (query) for extracting field data to be flowed from the database into the form. The query setting for the main form and the subform is different for the main form and the subform. Includes a flag indicating whether data is extracted in the query of, a flag indicating whether records are deleted (not extracted) when records of the same value are consecutive, and setting of quotes of a character string. FIG. 10 is an example of a screen for setting another query flag, duplicate record deletion flag, and quotation marks.

図11は、メインフォームとサブフォームのクエリ設定を行う画面の例である。画面の上半分のエリアでは、データを抽出するデータベースの複数のテーブルとフィールドの一覧を表示し、必要であればテーブルの結合を設定する。画面の下半分のエリアでは、テーブル中の抽出対象フィールド(集計やスカラー演算を含む)と、抽出条件などを設定する。この設定は、メインフォームとサブフォームの各々に対して行われる。例えば、ユーザからの指示に基づいて、メインフォームの抽出条件として(注文日>2002/01/01 AND 注文日<2002/12/31)を設定し、サブフォームの抽出条件として(個数>5)を設定するなどが可能であるとする。   FIG. 11 is an example of a screen for performing query settings for the main form and the subform. In the upper half area of the screen, a list of tables and fields of the database from which data is extracted is displayed, and table joins are set if necessary. In the lower half area of the screen, fields to be extracted (including aggregation and scalar calculation) in the table, extraction conditions, etc. are set. This setting is performed for each of the main form and the subform. For example, based on an instruction from the user, (order date> 2002/01/01 AND order date <2002/12/31) is set as the extraction condition for the main form, and (number> 5) as the extraction condition for the subform. Can be set.

別クエリフラグがOFFの場合は、メインフォームクエリ設定とサブフォームクエリ設定をあわせたクエリ設定で1つのクエリを生成するのに対し、別クエリフラグがONの場合は、メインフォームクエリ設定とサブフォームクエリ設定から各々別のクエリを生成する。詳細は、後述する。   When the other query flag is OFF, one query is generated with the query setting that combines the main form query setting and the subform query setting, whereas when the other query flag is ON, the main form query setting and the subform Generate a separate query for each query setting. Details will be described later.

フォームデータ706は、帳票の固定部分のデザインとフィールド定義を含んでいる。フィールド定義は、メインフォームのフィールドとサブフォームの明細行や集計行の設定を含み、また、クエリ情報705のクエリ設定に対応したフィールド定義を持つフォームデータをあらかじめ読み込んで格納しておく。   Form data 706 includes the design and field definition of the fixed part of the form. The field definition includes settings for the main form fields and subform detail lines and summary lines. In addition, form data having field definitions corresponding to the query settings of the query information 705 is read and stored in advance.

次に、本実施形態で実行される処理の詳細について説明する。   Next, details of processing executed in the present embodiment will be described.

始めに、全体の動作を図3のフローチャートに基づいて説明する。この処理は、図10や図11での設定が行われた後に実行されるものとする。まず、クエリ情報705の別クエリフラグがONか判定する(ステップS301)。OFFであると判定された場合、ステップS302に進んで、クエリ情報705のメインフォームクエリ設定とサブフォームクエリ設定をあわせたクエリ設定で1つのクエリを生成する。つまり、メインフォームクエリ設定の抽出対象フィールドとサブフォームクエリ設定の抽出対象フィールドとを加えたものを抽出対象フィールドとし、メインフォームクエリ設定の抽出条件とサブフォームクエリ設定の抽出条件のANDを抽出条件とした1つのクエリを生成する。そして、当該生成されたクエリを実行し(ステップS303)、データベースが返してきた抽出結果の複数のレコードをプログラムワークメモリ707上のレコード変数Rに格納する(ステップS304)。そして、Rの各レコードをフィールドデータとしてメインフォームとサブフォームに流し込む(ステップS305〜S308)。サブフォームは表形式なのでレコードを順次流し込むと新しい行として追加されていくが、メインフォームは単票形式なのでレコードを順次流し込むと改ページブレイクするまでは同じフィールドに上書き(もしくは後続無視)される。   First, the overall operation will be described based on the flowchart of FIG. This process is executed after the setting in FIG. 10 and FIG. 11 is performed. First, it is determined whether another query flag of the query information 705 is ON (step S301). If it is determined to be OFF, the process proceeds to step S302, and one query is generated with a query setting that combines the main form query setting and the subform query setting of the query information 705. In other words, the extraction target field is the sum of the extraction target field of the main form query setting and the extraction target field of the subform query setting, and the AND of the extraction condition of the main form query setting and the extraction condition of the subform query setting is the extraction condition. One query is generated. Then, the generated query is executed (step S303), and a plurality of records of the extraction results returned by the database are stored in the record variable R on the program work memory 707 (step S304). Then, each record of R is poured into the main form and subform as field data (steps S305 to S308). Since the subform is a tabular format, new records are added as records are flowed sequentially. However, since the main form is a single-sheet format, if the records are flowed sequentially, the same field is overwritten (or ignored) until a page break occurs.

一方、ステップS301においてONであると判定された場合、ステップS309に進んで別クエリ処理を行う。次に、ステップS309の別クエリ処理を図4を用いて詳細に説明する。   On the other hand, if it is determined in step S301 that it is ON, the process proceeds to step S309 and another query process is performed. Next, another query process in step S309 will be described in detail with reference to FIG.

まず、クエリ情報705のメインフォームクエリ設定で設定された抽出条件に基づいてメインフォームのクエリを生成し(ステップS401)、生成したクエリを実行し(ステップS402)、データベースが返してきた抽出結果の複数のレコードをプログラムワークメモリ707上のメインフォームレコードを格納する変数MRに、レコード数を変数MCに格納する(ステップS403)。ループ変数iを0で初期化し(ステップS404)、iがMCよりも小さいか判定し(ステップS405)、小さければ、MRのi番目のレコード(0オリジン)をメインフォームに流し込み(ステップS406)、MRのi番目のレコードに対応するサブフォームクエリ処理(後述する)を行い(ステップS407)、iをカウントアップし(ステップS408)、ステップS405に戻り、MRのレコードがなくなるまでループして処理を行ったら、処理を抜ける。   First, a main form query is generated based on the extraction conditions set in the main form query setting of the query information 705 (step S401), the generated query is executed (step S402), and the extraction result returned by the database is returned. A plurality of records are stored in the variable MR for storing the main form record on the program work memory 707, and the number of records is stored in the variable MC (step S403). The loop variable i is initialized to 0 (step S404), and it is determined whether i is smaller than MC (step S405). If it is smaller, the MR's i-th record (0 origin) is poured into the main form (step S406). Sub-form query processing (described later) corresponding to the i-th record of MR is performed (step S407), i is counted up (step S408), and the process returns to step S405, and loops until the MR record is exhausted. When done, exit the process.

続いて、サブフォームクエリ処理S407について図5を用いて詳細に説明する。まず、クエリ情報705のサブフォームクエリ設定で設定された抽出条件とi番目のMRのレコードから、メインフォームのクエリとは別のサブフォームのクエリを生成する(ステップS501)。サブフォームのクエリは、サブフォームクエリ設定で設定された抽出条件と、i番目のMRのレコードの値とのANDに基づいて1つのクエリを生成する。例えば、図12のような帳票の場合、1番目のMRには、(注文No,注文日,顧客名)=(0011,2002/○/×,XXXX株式会社)というレコードが格納されているので、サブフォームのクエリ設定の抽出条件に、(注文No,注文日,顧客名)=(0011,2002/○/×,XXXX株式会社)をANDで加える。これにより、i番目のメインフォームのレコードに対応したサブフォームのレコードのみが抽出できる。なお、i番目のMRのレコードの値とのANDを取る際、サブフォームのテーブルに含まれていないフィールドについては抽出条件から除外するものとする。   Next, the subform query process S407 will be described in detail with reference to FIG. First, a subform query different from the main form query is generated from the extraction condition set in the subform query setting of the query information 705 and the i-th MR record (step S501). The subform query generates one query based on the AND of the extraction condition set in the subform query setting and the value of the i-th MR record. For example, in the case of a form as shown in FIG. 12, the first MR stores a record of (order number, order date, customer name) = (0011, 2002 / ○ / x, XXX Corporation). Then, (order No, order date, customer name) = (0011, 2002 / o / x, XXX Corporation) is added to the extraction condition of the query setting of the subform by AND. Thereby, only the record of the subform corresponding to the record of the i-th main form can be extracted. When ANDing with the value of the i-th MR record, fields that are not included in the subform table are excluded from the extraction conditions.

次に、S501で生成したクエリを実行し(ステップS502)、データベースが返してきた抽出結果の複数のレコードをプログラムワークメモリ707上のレコード変数SRに、レコード数を変数SCに格納する(ステップS503)。ループ変数jを0で初期化し(ステップS504)、jがSCよりも小さいか判定し(ステップS505)、小さければ、SRのj番目のレコード(0オリジン)をサブフォームに流し込み(ステップS506)、jをカウントアップし(ステップS507)、ステップS505に戻り、SRのレコードがなくなるまでループして処理を行ったら、処理を抜ける。   Next, the query generated in S501 is executed (step S502), and a plurality of records of the extraction results returned by the database are stored in the record variable SR on the program work memory 707, and the number of records is stored in the variable SC (step S503). ). The loop variable j is initialized with 0 (step S504), and it is determined whether j is smaller than SC (step S505). If it is smaller, the jth record (0 origin) of SR is poured into the subform (step S506). j is incremented (step S507), the process returns to step S505, and if the process is looped until there is no SR record, the process is exited.

上述したように、本実施形態によれば、データベースからの抽出結果のデータ中にメインフォームのデータが繰り返し入ることがなくなり、抽出結果の全体的なデータ量が小さくなる。特に、1度に膨大なデータを抽出する場合やネットワーク経由でデータベース装置に接続している場合、帳票作成処理での必要メモリが小さくて済んだり、データベースからのデータ転送時間が最小限で済むという効果がある。   As described above, according to the present embodiment, the data of the main form is not repeatedly included in the data of the extraction result from the database, and the overall data amount of the extraction result is reduced. In particular, if a large amount of data is extracted at once, or if it is connected to a database device via a network, the required memory for form creation processing can be reduced, and the time required to transfer data from the database can be minimized. effective.

また、別クエリ処理にすると抽出結果のデータ量は小さく出来るが、クエリ実行の回数が増えるので、別クエリ処理と単一クエリ処理とを切り替え可能とすることにより、使用可能メモリが大量にある場合やデータベースがローカル接続されている場合など、抽出結果のデータ量よりもクエリ回数の方が処理速度に大きく影響する環境に対しても対応することが出来るという効果がある。   Also, if you use separate query processing, the amount of data in the extraction result can be reduced, but the number of query executions increases, so if you can switch between separate query processing and single query processing, there is a large amount of available memory There is an effect that it is possible to cope with an environment where the number of queries greatly affects the processing speed rather than the amount of data of the extraction result, such as when the database is connected locally.

本発明の一実施形態であるシステムの全体構成を示す図である。1 is a diagram illustrating an overall configuration of a system according to an embodiment of the present invention. ハードウェア構成を示すブロック図である。It is a block diagram which shows a hardware configuration. 本実施形態における処理手順を示すフローチャートである。It is a flowchart which shows the process sequence in this embodiment. 別クエリ処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of another query process. サブフォームクエリ処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of a subform query process. 記憶媒体に格納された帳票作成プログラムの構成を示す図である。It is a figure which shows the structure of the form creation program stored in the storage medium. プログラムが実行可能となった状態のメモリマップである。It is a memory map in a state where a program can be executed. DB接続情報の説明図である。It is explanatory drawing of DB connection information. クエリ情報の説明図である。It is explanatory drawing of query information. 別クエリフラグ等のクエリ情報の設定画面の一例を示す図である。It is a figure which shows an example of the setting screen of query information, such as another query flag. クエリ設定の設定画面の一例を示す図である。It is a figure which shows an example of the setting screen of query setting. サブフォームを含む帳票の一例を示す図である。It is a figure which shows an example of the form containing a subform. 複数のテーブルから1つのクエリでサブフォームを含むフィールドデータを抽出する一例を示す図である。It is a figure which shows an example which extracts the field data containing a subform with one query from several tables.

Claims (5)

第1フォーム部分と第2フォーム部分とから構成される帳票に、データベースから抽出したデータを流し込んで帳票を作成する帳票作成装置であって、
前記第1フォーム部分に流し込む第1のデータの抽出条件を示す第1抽出条件と、前記第2フォーム部分に流し込む第2のデータの抽出条件を示す第2抽出条件とを設定する抽出条件設定手段と、
前記第1フォーム部分と前記第2フォーム部分とのそれぞれに対して別のクエリを用いてデータを抽出する別クエリ処理と、前記第1フォーム部分と前記第2フォーム部分との両方に対する単一のクエリを用いてデータを抽出する単一クエリ処理とを切り替える切替手段と、
前記第1抽出条件に基づいて第1フォーム部分のクエリを生成して実行することにより、複数のレコードを含む前記第1のデータを前記データベースから抽出する第1データ抽出手段と、
前記第1データ抽出手段で抽出された第1のデータに含まれるレコードの1つを帳票の第1フォーム部分に流し込み、当該第1フォーム部分に流し込まれた1つのレコードと前記第2抽出条件とを用いて第2フォーム部分のクエリを生成して実行することにより、前記第2のデータを前記データベースから抽出し、更に、当該1つのレコードが第1フォーム部分に流し込まれている帳票の第2フォーム部分に対して当該抽出した第2のデータを流し込むことによって帳票を作成する処理を実行する第1帳票作成手段と、
前記第1抽出条件と前記第2抽出条件とを合わせた1つのクエリを生成して実行することにより、前記第1フォーム部分と前記第2フォーム部分とに流し込む第3のデータを前記データベースから抽出する第3データ抽出手段と、
前記第3データ抽出手段で抽出した第3のデータを、前記第1フォーム部分と前記第2フォーム部分とに流し込んで帳票を作成する処理を実行する第2帳票作成手段とを有し、
前記切替手段で前記別クエリ処理に切り替えられた場合、前記第1データ抽出手段で前記第1のデータを抽出し、更に、当該抽出した前記第1のデータに含まれるレコードを1つずつ順番に用いて、当該第1のデータに含まれる全てのレコードを処理するまで前記第1帳票作成手段の処理を繰り返し実行し、
一方、前記切替手段で前記単一クエリ処理に切り替えられた場合、前記第3データ抽出手段で前記第3のデータを抽出し、更に、当該抽出した第3のデータを用いて、前記第2帳票作成手段の処理を実行することを特徴とする帳票作成装置。
A form creation device for creating a form by pouring data extracted from a database into a form composed of a first form part and a second form part,
Extraction condition setting means for setting a first extraction condition indicating the extraction condition of the first data flowing into the first form portion and a second extraction condition indicating the extraction condition of the second data flowing into the second form portion. When,
A separate query process for extracting data using a separate query for each of the first form part and the second form part, and a single query for both the first form part and the second form part Switching means for switching between single query processing for extracting data using a query,
First data extraction means for extracting the first data including a plurality of records from the database by generating and executing a query of the first form part based on the first extraction condition;
One of the records included in the first data extracted by the first data extraction means is poured into the first form portion of the form, one record poured into the first form portion, the second extraction condition, The second data is extracted from the database by generating and executing the query of the second form part using the second, and the second of the form in which the one record is poured into the first form part. First form creation means for executing a process of creating a form by pouring the extracted second data into the form part;
By generating and executing one query that combines the first extraction condition and the second extraction condition, the third data that flows into the first form part and the second form part is extracted from the database. Third data extraction means for
Second form creation means for executing a process of creating a form by pouring the third data extracted by the third data extraction means into the first form portion and the second form portion ;
When switched to said further query processing by said switching means, said extracting said first data by the first data extracting means, further, the records contained in the first data the extracted one by one And repeatedly executing the processing of the first form creation means until all the records included in the first data are processed ,
On the other hand, when the switching unit switches to the single query processing, the third data extraction unit extracts the third data, and further uses the extracted third data to extract the second form. A form creation device characterized by executing processing of a creation means .
前記第1フォーム部分はメインフォームであり、前記第2フォーム部分はサブフォームであることを特徴とする請求項1に記載の帳票作成装置The form creation apparatus according to claim 1, wherein the first form part is a main form, and the second form part is a subform. コンピュータに、第1フォーム部分と第2フォーム部分とから構成される帳票に、データベース装置のデータベースから抽出したデータを流し込んで帳票を作成させるためのプログラムであって、
前記コンピュータを、
前記第1フォーム部分に流し込む第1のデータの抽出条件を示す第1抽出条件と、前記第2フォーム部分に流し込む第2のデータの抽出条件を示す第2抽出条件とを設定する抽出条件設定手段、
前記第1フォーム部分と前記第2フォーム部分とのそれぞれに対して別のクエリを用いてデータを抽出する別クエリ処理と、前記第1フォーム部分と前記第2フォーム部分との両方に対する単一のクエリを用いてデータを抽出する単一クエリ処理とを切り替える切替手段、
前記第1抽出条件に基づいて第1フォーム部分のクエリを生成して実行することにより、複数のレコードを含む前記第1のデータを前記データベースから抽出する第1データ抽出手段、
前記第1データ抽出手段で抽出された第1のデータに含まれるレコードの1つを帳票の第1フォーム部分に流し込み、当該第1フォーム部分に流し込まれた1つのレコードと前記第2抽出条件とを用いて第2フォーム部分のクエリを生成して実行することにより、前記第2のデータを前記データベースから抽出し、更に、当該1つのレコードが第1フォーム部分に流し込まれている帳票の第2フォーム部分に対して当該抽出した第2のデータを流し込むことによって帳票を作成する処理を実行する第1帳票作成手段、
前記第1抽出条件と前記第2抽出条件とを合わせた1つのクエリを生成して実行することにより、前記第1フォーム部分と前記第2フォーム部分とに流し込む第3のデータを前記データベースから抽出する第3データ抽出手段、
前記第3データ抽出手段で抽出した第3のデータを、前記第1フォーム部分と前記第2フォーム部分とに流し込んで帳票を作成する処理を実行する第2帳票作成手段、として機能させるためのプログラムであり、
更に、前記切替手段で前記別クエリ処理に切り替えられた場合、前記第1データ抽出手段で前記第1のデータを抽出し、更に、当該抽出した前記第1のデータに含まれるレコードを1つずつ順番に用いて、当該第1のデータに含まれる全てのレコードを処理するまで前記第1帳票作成手段の処理を繰り返し実行し、一方、前記切替手段で前記単一クエリ処理に切り替えられた場合、前記第3データ抽出手段で前記第3のデータを抽出し、更に、当該抽出した第3のデータを用いて、前記第2帳票作成手段の処理を実行するように、前記コンピュータを機能させることを特徴とするプログラム。
The computer, to the form composed of a first foam portion and a second foam portion, a program for making creates a form by pouring the data extracted from the database of the database apparatus,
The computer,
Extraction condition setting means for setting a first extraction condition indicating the extraction condition of the first data flowing into the first form portion and a second extraction condition indicating the extraction condition of the second data flowing into the second form portion. ,
A separate query process for extracting data using a separate query for each of the first form part and the second form part, and a single query for both the first form part and the second form part Switching means for switching between single query processing for extracting data using a query,
First data extraction means for extracting the first data including a plurality of records from the database by generating and executing a query of the first form part based on the first extraction condition;
One of the records included in the first data extracted by the first data extraction means is poured into the first form portion of the form, one record poured into the first form portion, the second extraction condition, The second data is extracted from the database by generating and executing the query of the second form part using the second, and the second of the form in which the one record is poured into the first form part. First form creation means for executing a process of creating a form by flowing the extracted second data into the form part;
By generating and executing one query that combines the first extraction condition and the second extraction condition, the third data that flows into the first form part and the second form part is extracted from the database. Third data extraction means for
A program for causing the third data extracted by the third data extraction means to flow into the first form part and the second form part to function as second form creation means for executing a process for creating a form And
Further, when the switching means switches to the different query processing, the first data extracting means extracts the first data , and further records one by one in the extracted first data. When used in order, repeatedly execute the processing of the first form creation means until all records included in the first data are processed , while the switching means is switched to the single query processing, Extracting the third data by the third data extraction means, and further causing the computer to function so as to execute the processing of the second form creation means by using the extracted third data. A featured program.
前記第1フォーム部分はメインフォームであり、前記第2フォーム部分はサブフォームであることを特徴とする請求項に記載のプログラム。 The program according to claim 3 , wherein the first form part is a main form and the second form part is a subform. 請求項3に記載のプログラムを格納したコンピュータ読み取り可能な記憶媒体。 A computer-readable storage medium storing the program according to claim 3 .
JP2003278287A 2003-07-23 2003-07-23 Form creation device, program Expired - Fee Related JP4343613B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003278287A JP4343613B2 (en) 2003-07-23 2003-07-23 Form creation device, program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003278287A JP4343613B2 (en) 2003-07-23 2003-07-23 Form creation device, program

Publications (2)

Publication Number Publication Date
JP2005044175A JP2005044175A (en) 2005-02-17
JP4343613B2 true JP4343613B2 (en) 2009-10-14

Family

ID=34264746

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003278287A Expired - Fee Related JP4343613B2 (en) 2003-07-23 2003-07-23 Form creation device, program

Country Status (1)

Country Link
JP (1) JP4343613B2 (en)

Also Published As

Publication number Publication date
JP2005044175A (en) 2005-02-17

Similar Documents

Publication Publication Date Title
JP5337023B2 (en) Presenting data to the user in a three-dimensional table
US8407262B2 (en) Systems and methods for generating an entity diagram
TW200809551A (en) Attribute-based symbology through functional styles
JP2003157264A (en) Sentence management system, management method thereof, and program therefor
JP2007109221A (en) Part management system, part management method, program and recording medium
CN113342249B (en) Content management method, device, equipment and storage medium capable of previewing in real time
JP2005242904A (en) Document group analysis device, document group analysis method, document group analysis system, program and storage medium
JP4343613B2 (en) Form creation device, program
US6748384B1 (en) System and method for dynamically summarizing data stores
EP1901189A2 (en) Parts managing system, parts managing method, computer program and computer readable storage medium
JP2011237909A (en) Search screen display device, search screen display method, and search screen display program
JP2003150762A (en) Cooperation method for project information and its system
JP4327686B2 (en) Method and system for supporting construction of individual system based on EA
JP5861545B2 (en) Information processing apparatus, history control method, and history control program
CN105630998A (en) Metadata management method, device and system
JPWO2004090726A1 (en) Database replication program and database replication apparatus
CN109076110A (en) Image sending method, device and storage medium
JP2002351629A (en) Print system and information processor
JP2005085082A (en) Page change device and method
JP2002123476A (en) System for managing electronic mail data
JP3209387B2 (en) Node optimal arrangement method and apparatus
JP2021051388A (en) Information processing device and program
JP2006120037A (en) Device, method and program for processing tabular data
JP2008242562A (en) Simulation system, server and program
JP2004192221A (en) Document retrieval processing method and device, and recording medium with the method recorded

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060721

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060905

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061106

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070109

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070312

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20070412

A912 Re-examination (zenchi) completed and case transferred to appeal board

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20070427

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090709

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

Free format text: PAYMENT UNTIL: 20120717

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4343613

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120717

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130717

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees