Example of correcting an error during an Edit session

If an error occurs during an Edit session, FM/Db2 displays =ERR , =ERR R, or the SQLCODE in the prefix area of the row (or rows) in error. Example: error indicated during Edit session shows an error has occurred for one row.

Figure 1. Example: error indicated during Edit session
  Process   Options   Utilities   Help
────────────────────────────────────────────────────────────────────────────────
 FM/Db2 (DFG2)                     Table Edit                           1 of 42
 TABLE FMNUSER.EMP                                                  Format TABL
        EMPNO  FIRSTNME     MIDINIT LASTNAME        WORKDEPT PHONENO HIREDATE
        #1     #2           #3      #4              #5       #6      #7
        CH(6)  VARCHAR(12)  CH(1)   VARCHAR(15)     CH(3)    CH(4)   DATE
        PU--+> <---+----1-> -       <---+----1----> <-NF     <-->    <---+---->
 000000 ****  Top of data  ****
 000001 000010 CHRISTINE<   I       HAAS<           A00      3978    01/01/1965
 000002 000020 MICHAEL<     L       THOMPSON<       B01      3476    10/10/1973
 000003 000030 SALLY<       A       KWAN<           C01      4738    04/05/1975
 000004 000050 JAN<         B       GEYER<          E01      6789    08/17/1949
 -803   000050 IRVING<      F       STERN<          D11      6423    09/14/1973 
 000006 000070 EVA<         D       PULASKI<        D21      7831    09/30/1980
 000007 000090 EILEEN<      W       HENDERSON<      E11      5498    08/15/1970
 000008 000100 THEODORE<    Q       SPENCER<        E21      0972    06/19/1980
 000009 000110 VINCENZO<    G       LUCCHESI<       A00      3490    05/16/1958
 000010 000120 SEAN<                O'CONNELL<      A00      2167    12/05/1963
 000011 000130 DOLORES<     M       QUINTANA<       C01      4578    07/28/1971
 000012 000140 HEATHER<     A       NICHOLLS<       C01      1793    12/15/1976
 Command ===> _____________________________________________________ Scroll PAGE
  F1=Help      F2=Zoom      F3=Exit      F4=CRetriev  F5=RFind     F6=RChange
  F7=Up        F8=Down      F9=Swap     F10=Left     F11=Right    F12=Cancel

To determine the type of error, type E in the prefix area for the row in error and press Enter. FM/Db2 displays an error information panel that describes the error and instructions about what you can do to correct the error.

Figure 2. Example: error information describing the type of error that occurred during an Edit session
   ┌────────────────── Db2 Save Error Action ──────────────────┐
 s │                                                           │ ───────────────
 F │ Db2 reported an error while attempting to save this row.  │        1 of 42
 L │                                                           │    Format TABL
   │ Duplicate Row Error                                       │ ENO HIREDATE
   │                                                           │     #7
   │ The insert or update operation on this line would have    │ )   DATE
   │ resulted in two rows with the same index key, and the     │     <---+---->
 0 │ index is defined as unique.                               │
 0 │                                                           │     01/01/1965
 0 │ Instructions:                                             │     10/10/1973
 0 │                                                           │     04/05/1975
 0 │    Press ENTER or enter EXIT to return to the edit        │     08/17/1949
 E │    session and correct the error in this line.            │     09/14/1973
 0 │                                                           │     09/30/1980
 0 │    Enter CANCEL to terminate the Edit session.            │     08/15/1970
 0 │    Any changes made since the last commit point           │     06/19/1980
 0 │    will be lost.                                          │     05/16/1958
 0 │                                                           │     12/05/1963
 0 │                                                           │     07/28/1971
 0 │ Command ===>                                              │     12/15/1976
 C │  F1=Help       F2=Split      F3=Exit       F7=Backward    │    Scroll PAGE
   │  F8=Forward    F9=Swap      F12=Cancel                    │   F6=RChange
   └───────────────────────────────────────────────────────────┘  F12=Cancel
You can then take one of the following actions:
  • Cancel the Edit session by pressing the Cancel function key (F12). Any uncommitted changes are lost.
  • Press Enter or the Exit function key (F3) to return to the Edit session.
  • Use the REDIT primary command (if the error information panel offers it as an option) to edit the related table to correct the error.
    Note: If the error information panel does not offer the REDIT primary command as an option, REDIT displays an Edit session.

In the example shown in Example: error indicated during Edit session, the error has been caused by two rows having the same index key (rows 4 and 5 both have an EMPNO of 000050). To correct the error:

  1. Press Enter to return to the Edit session.
  2. Change the offending index key for row 5 to a unique value such as 000060.
  3. Press the Exit function key (F3) to return to the Edit session.

Related references