ステップ 4.FM/Db2 エディターの使用 (通常編集、関連編集)
FM/Db2 にログオンして、ステップ 1。検証中に使用される Db2 オブジェクトの定義で指定したのと同じ Db2® システムに接続します。FM/Db2 メインメニューで「2」と入力して、FM/Db2 エディターを選択します。[Enter] を押します。図 1. Db2® 「Edit (編集)」パネル
Process Options Utilities Help ────────────────────────────────────────────────────────────────────────────── FM/Db2 (DFF2) Db2 Edit Command ===> Db2 Object: Location . . . . . Database . . . (optional) Owner . . . . . . . FMN0USR + Table Space . . (optional) Name . . . . . . . * + Start position . . 1 Row count . . . . . 100 Number of rows to edit Template: Data set name . . . Member . . . . . . Processing Options: Template usage Enter "/", "A"lways to select option 3 1. Above Edit options 2. Previous Edit template 3. Generate from table Re-edit template 4. Generate/Replace / Create audit trail (Option fixed) F1=Help F2=Split F3=Exit F4=Expand F7=Backward F8=Forward F9=Swap F10=Left F11=Right F12=Cancel
Db2 「Edit (編集)」パネルを参照してください。図に示すように、Owner (所有者)
フィールドに <Test>0USR、Name (名前)
フィールドに「*」の値を入力します。
Enter キーを押して、Table/View/Alias Selection (表/ビュー/別名選択)
パネルを表示します。「Table/View/Alias Selection (表/ビュー/別名選択)」パネルを参照してください。
Process Options Utilities Help ────────────────────────────────────────────────────────────────────────────── FM/Db2 (DFF2) Table/View/Alias Selection Top of 8 Command ===> Scroll CSR 8 rows fetched Format TABL TABLE TABLE TABLE DATABASE SPACE OBJECT SEL OWNER NAME NAME NAME TYPE * * * * * ---- #2--+--- #1--+----1----+----2-- #4--+--- #5--+--- #7--+- **** Top of data **** FMN0USR Department-Info-Errors FMN0IVD FMN9IVSR TABLE S FMN0USR Department-Information FMN0IVD FMN0IVSD TABLE FMN0USR Employee-Detail FMN0IVD FMN9IVSE TABLE FMN0USR Employee-Detail-Copy FMN0IVD FMN9IVSC TABLE FMN0USR Employee-Detail-Errors FMN0IVD FMN9IVSR TABLE FMN0USR VDEPT FMN0IVD FMN0IVSD VIEW FMN0USR VEMP FMN0IVD FMN9IVSE VIEW FMN0USR VHDEPT FMN0IVD FMN0IVSD VIEW **** End of data **** F1=Help F2=Zoom F3=Exit F4=CRetriev F5=RFind F6=RChange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
表の 図 3. 「Table Edit (表編集)」パネル
Department-Information (部門情報)フィールドに「S」を入力して、Enter キーを押します。「Table Edit (表編集)」パネルを参照してください。
Process Options Utilities Help ────────────────────────────────────────────────────────────────────────────── FM/Db2 (DFF2) Table Edit Top of 16 Command ===> Scroll CSR TABLE FMN0USR.Department-Information Format TABL Department Code Department Name Manager Employee N #1 #2 #3 CHARACTER(3) VARCHAR(36) CHARACTER(6) PU> <---+----1----+----2----+----3----+> <-N-+> ****** **** Top of data **** 000001 S00 Spiffy Computer Service Division< 000010 000002 P01 Planning Department< 000020 000003 I01 Information Center< 000030 000004 D01 Development Center< _ 000005 M10 Manufacturing Systems< 000060 000006 A10 Administration Systems< 000070 000007 S11 Support Services< 000050 000008 D11 Operations< 000090 000009 S12 Software Support< 000100 000010 B22 Singapore Branch Office< _ 000011 B23 Manila Branch Office< _ 000012 B24 Jakarta Branch Office< _ F1=Help F2=Zoom F3=Exit F4=CRetriev F5=RFind F6=RChange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
「Table Edit (表編集)」パネル (上書きされた「Manager Employee Number (管理職従業員番号)」を示しています)に示すように、2 行目の「Manager Employee Number (管理職従業員番号)」の値を上書きします。値を「XXXXXX」に変更して、PF3 を押します。「Table Edit (表編集)」パネル (修正された「Manager Employee Number (管理職従業員番号)」を示しています)を参照して、PF3 (EXIT (終了)) キーを押したときの FM/Db2 の応答を確認してください。図 4. 「Table Edit (表編集)」パネル (上書きされた「Manager Employee Number (管理職従業員番号)」を示しています)
図 5. 「Table Edit (表編集)」パネル (修正された「Manager Employee Number (管理職従業員番号)」を示しています)
Process Options Utilities Help ────────────────────────────────────────────────────────────────────────────── FM/Db2 (DFF2) Table Edit Top of 16 Command ===> Scroll CSR TABLE FMN0USR.Department-Information Format TABL Department Code Department Name Manager Employee N #1 #2 #3 CHARACTER(3) VARCHAR(36) CHARACTER(6) PU> <---+----1----+----2----+----3----+> <-N-+> ****** **** Top of data **** 000001 S00 Spiffy Computer Service Division< 000010 000002 P01 Planning Department< XXXXXX 000003 I01 Information Center< 000030 000004 D01 Development Center< _ 000005 M10 Manufacturing Systems< 000060 000006 A10 Administration Systems< 000070 000007 S11 Support Services< 000050 000008 D11 Operations< 000090 000009 S12 Software Support< 000100 000010 B22 Singapore Branch Office< _ 000011 B23 Manila Branch Office< _ 000012 B24 Jakarta Branch Office< _ F1=Help F2=Zoom F3=Exit F4=CRetriev F5=RFind F6=RChange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
Process Options Utilities Help ────────────────────────────────────────────────────────────────────────────── FM/Db2 (DFF2) Table Edit Commit issued (Errors) Command ===> Scroll CSR TABLE FMN0USR.Department-Information Format TABL Department Code Department Name Manager Employee N #1 #2 #3 CHARACTER(3) VARCHAR(36) CHARACTER(6) PU> <---+----1----+----2----+----3----+> <-N-+> ****** **** Top of data **** 000001 S00 Spiffy Computer Service Division< 000010 =ERR R P01 Planning Department< XXXXXX 000003 I01 Information Center< 000030 000004 D01 Development Center< _ ⋮ F1=Help F2=Zoom F3=Exit F4=CRetriev F5=RFind F6=RChange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
Manager Employee Number (管理職従業員番号)
の変更内容は保管できません。エラーとなった行には '=ERR R'
のマークが付けられています。この行の接頭部域を「e」で上書きして、Enter キーを押します。「Manager Employee Number (管理職従業員番号)」が修正された「Table Edit (表編集)」 を参照してください。
Process Options Utilities Help ────────────────────────────────────────────────────────────────────────────── FM/Db2 (DFF2) Table Edit Commit issued (Errors) Command ===> Scroll CSR TABLE FMN0USR.Department-Information Format TABL Department Code Department Name Manager Employee N #1 #2 #3 CHARACTER(3) VARCHAR(36) CHARACTER(6) PU> <---+----1----+----2----+----3----+> <-N-+> ****** **** Top of data **** 000001 S00 Spiffy Computer Service Division< 000010 E RR R P01 Planning Department< XXXXXX 000003 I01 Information Center< 000030 000004 D01 Development Center< _ ⋮ F1=Help F2=Zoom F3=Exit F4=CRetriev F5=RFind F6=RChange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
FM/Db2 は、Db2 「 Save Error Action (保管エラー・アクション)」パネル に示すエラー・パネルを表示します。コマンド行に REDIT コマンドを入力して、Enter キーを押します。関係の親表を表示するには、「Table Edit (related) (表編集 (関連))」パネル を参照してください。図 7. Db2® 「 Save Error Action (保管エラー・アクション)」パネル
図 8. 「Table Edit (related) (表編集 (関連))」パネル
Process Help ────────────────────────────────────────────────────────────────────────────── FM/Db2 (DFF2) Db2 Save Error Action Command ===> Db2 reported a No Primary Key error while attempting to save this row. See below for key column details. Relationship : Manager must be Employee Parent table : FMN0USR.Employee-Detail Dependent table : FMN0USR.Department-Information Explanation: The insert or update operation on this line would have resulted in a foreign key value for which there is no corresponding primary key value. Instructions: Type REDIT on the command line to edit the parent table shown above. Press ENTER or enter EXIT to return to the edit session and correct the error. Press the CANCEL key to terminate the edit session. Any changes made since the last commit point will be lost. Parent Column Name Depndnt Column Name Value Employee Number Manager Employee Num XXXXXX F1=Help F2=Split F3=Exit F4=Expand F7=Backward F8=Forward F9=Swap F10=Left F11=Right F12=Cancel
Process Options Utilities Help ────────────────────────────────────────────────────────────────────────────── FM/Db2 (DFF2) Table Edit (related) Parent table 48 rows - End of object. Format TABL Employee Number First Name Middle Initial Last Name Work Depart #1 #2 #3 #4 #5 CHARACTER(6) VARCHAR(12) CHARACTER(1) VARCHAR(15) CHARACTER(3 PU--+> <---+----1-> - <---+----1----> <-N ****** **** Top of data **** 000001 000010 Xena< B Howard< S00 000002 000020 Michelle< J Jackson< P01 000003 000030 James< Z Jones< I01 000004 000050 Jo-anne< G Gratten< S11 000005 000060 Jackson< P Costello< M10 000006 000070 Charles< A Abercrombie< A10 000007 000090 Eleni< MacMahon< D11 000008 000100 Junichi< K Funahashi< S12 000009 000110 Luigi< V Andretti< S00 000010 000120 Patrick< O O'Farrelly< S00 000011 000130 Megumi< Takami< I01 Command ===> Scroll CSR F1=Help F2=Zoom F3=Exit F4=CRetriev F5=RFind F6=RChange F7=Up F8=Down F9=Swap F10=Left F11=Right F12=Cancel
PF3 を押して、Employee-Detail (従業員の詳細情報)
表の <Test> 編集セッションを終了し、Department-Information (部門情報)
表の <Test> 編集セッションに戻ります。PF12 (CANCEL (取り消し)) を押して、FM/Db2 エディター機能の入力パネルに戻ります。操作の取り消しの確認を求めるポップアップ・パネルが表示されます。続行するには、Enter キーを押してください。