Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/COBOL/Test-Suite/SQL P/dml100-186/   (NIST Cobol Test-Suite ©)  Datei vom 4.1.2008 mit Größe 36 kB image not shown  

Quelle  dml118.cob   Sprache: Cobol

 

       IDENTIFICATION DIVISION.
             * This routine tests FIPS feature 19.     * This is the dynamic version of DML117.PC.                    
       ENVIRONMENT DIVISION.
             * REFERENCES                                                   
       SOURCE-COMPUTER      *   FIPS PUB 127-2 14.1 Transitional SQL                       
       OBJECT-COMPUTER.  xyz.
       DATA DIVISION.
       WORKING-STORAGE SECTION.


      * EMBEDDED COBOL (file "DML118.PCO")


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * DATE 1994/6/2 EMBEDDED COBOL LANGUAGE                            
      * NIST SQL VALIDATION TEST SUITE V6.0                          
      *  DISCLAIMER:                                                  
      *  This program was written by employees of NIST to test SQL    
      *  implementations for conformance to the SQL standards.        
      *  NIST assumes no responsibility for any party's use of        
      *  this program.
      *                                                              
      * DML118.PCO                                                    
      * WRITTEN BY:  David W. Flater                                 
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * This routine tests FIPS feature 19.                          
      * This is the dynamic version of DML117.PC.                    
      *                                                              
      * REFERENCES                                                   
      *   FIPS PUB 127-2 14.1 Transitional SQL                       
      *   ANSI SQL-1992                                              
      *                                                              
      ****************************************************************



           EXEC SQL BEGIN DECLARE SECTION END-EXEC
        SQLCODE PIC() .
       01  SQLSTATE PIC  X(5).
       01     (18.
       01  uidx PIC  X(18).
       01  int1 PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  int2 PIC S9(9) DISPLAY SIGN LEADING SEPARATE.
       01  dstmt PIC  X(50).
       01  longst PIC  X(240).
             EXEC              SQLEND SECTION 
01norm1 S9()DISPLAYSIGN LEADINGSEPARATE.
       01  norm2 PIC S9(9) DISPLAYSIGN  SEPARATEjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
       01ALPNUM-TABLEIS
               "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ".
           05  ALPNUM         .
         NORMSQ.
           05  NORMSQX           PIC(9 DISPLAY SIGN LEADING .
       01  errcnt PIC       01TO-DAY 9().
      *date_time declaration 
       01  TO-DAY  9(6).
       01  THE-TIME PIC 9(8).
       01  flag PIC S9(9) DISPLAY LEADING SEPARATE.

       01  SQL-COD PIC S9(9) DISPLAY SIGN LEADING SEPARATE.

       PROCEDURE DIVISION.
       P0.

             MOVE "FLATER            " TO uid
                          MOVEFLATER            "TOuid
             MOVE"not  in not"  uidx
             EXEC SQL SELECT USER INTO :uidx FROM HU.ECCO END-EXEC             MOVE "  in,not"TOuidx
             MOVE SQLCODE TO SQL-COD
             EXEC SQL ROLLBACK WORK END-EXEC
             MOVE SQLCODE               SQLCODE  
             if (uid  NOT  =   uidx) then
               DISPLAY "ERROR: User ", uid "               (uid       uidx)then
      -"connected"
            STOP RUN
             END-IF
            0 errcnt

             DISPLAY            STOPRUN
           "SQL Test Suite, V6.0, Embedded COBOL, dml118.pco"
             DISPLAY
           "9byte java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
             DISPLAY "  #java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
      *date_time print 
           ACCEPT TO-DAY FROM             " Version #java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
           ACCEPT THE-TIMEACCEPT   
                       DaterunYYMMDD     hhmmssff  

      ******************** BEGIN TEST0646 *******************
             MOVE                flag

             "Feature 19,Referential delete actions
             DISPLAY           dynamic)
      -    " (dynamic)"
DISPLAY:
             DISPLAY "    FIPS PUB 127-2 14.1 Transitional SQL features
      -    " 16, 19"
              "   11.8  LR2ajava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
             "114  .."
             DISPLAY "   - - - - - - - - - - - - - - - - - - -"

             COMPUTE SQLCODE = -1
             MOVE "xxxxx"TOSQLSTATE

      *Simulate a tiny OS with hard quotas (ick!) 

             EXEC SQL DELETE FROM CONCATBUF END-EXEC             MOVE"xxxxx" TO 
             MOVE SQLCODE TO SQL-COD
                          EXECSQL DELETEFROM CONCATBUF END-EXEC
               'CREATE TABLE LUSERS ('        ||
               ' PRIMARY KEY (LUSER_ID),'    ||
               '  NAAM         CHAR (10),'    ||
               '  LUSER_ID     INT,'          ||
               '  FILE_QUOTA   INT,'          ||
               '  FILE_USAGE   INT  , |java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
                FILE_USAGE= 0 AND' |
               '    (FILE_QUOTA                 NAAM         CHAR 10,    |
               ) END-EXEC
             MOVE                FILE_QUOTAINT          |
             EXECSQLSELECT ZZINTO:longst FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "               '   (ILE_USAGE>  ' |

              ""
             EXEC SQL COMMIT  )
              java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36
           PERFORM CHCKOK
             DISPLAY  " "

 "java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 49
              java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 45
             MOVE SQLCODE 
           PERFORM CHCKOK
" java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             DISPLAY "COMMIT WORK;"
             EXEC SQL             DISPLAY   "
             MOVE SQLCODE TO SQL-COD
java.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25
             DISPLAY  " "

      *When you delete a user, all his/her files are also deleted 

             EXEC              MOVE SQLCODETO SQL-COD
             MOVESQLCODE  SQL-COD
             EXEC SQL INSERTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               CREATETABLE (
                   ||
               '  FOREIGN KEY (LUSER_ID) REFERENCES LUSERS ON DELETE
CASCADE' |java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
               '  PRIMARY           PERFORM 
                   ||
               '  FILE_NAME     java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
                   ||
                 INTNOTNULL'                          
                   ||
               '  LUSER_DATA   CHAR (30))'
               )
             MOVE SQLCODE TO SQL-COD
EXEC SELECTZZINTO:  CONCATBUFjava.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68
             MOVE              DISPLAY   java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             DISPLAY "longst=""", longst """"

             DISPLAY "COMMIT WORK;"
             EXECSQL COMMIT WORK END-EXEC
             MOVE java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
           PERFORM CHCKOK
             DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

             DISPLAY "EXECUTE IMMEDIATE :longst;"
            SQL IMMEDIATElongst
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY                     |
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'CREATE TABLE AUDIT_CODES ('                             
                     |                     |
               '          PRIMARY KEY'java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                     ||
               '                       |
                     |
               '  CHECK (LUSER_ACTION = ''INSERT'' OR LUSER_ACTION =
''' |
               '    OR LUSER_ACTION = ''DELETE''))'
               ) END-EXEC
 java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36
             EXEC SQL SELECT ZZ INTO               SQLCODETO 
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""",              SQLCOMMIT  END-EXEC

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 25
           
               "

             "XECUTE  longst;"
             EXEC MOVESQLCODETOSQL-COD
             MOVE SQLCODE SQL-COD
           PERFORM  DISPLAY   java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY""

             DISPLAY "COMMIT WORK;"
             EXECSQL  WORK java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *This table ostensibly separates UID's that have been valid at s
      *time in history from those that have always been invalid.      

DISPLAY"="  ALL_USER_IDSLUSER_IDINT
      -    " UNIQUE)"""
MOVE CTABLE LINT  "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
                           "REATETABLEALL_USER_IDS(LUSER_IDINT )  "
             MOVE   SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "COMMIT WORK;"
             EXEC             EXEC SQLEXECUTE  :dstmtEND-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOKPERFORM CHCKOK
             ""

      *The persistent audit records need to be consistent in the    
      *event that a LUSER_ID is recycled after someone is deleted.  
      *The original LUSER_ID is preserved in SAVED_LUSER_ID in case 
      *it is needed.                                                

                          MOVE   
             DISPLAY
-"DELETE NULL,java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
             DISPLAY "  LUSER_ID         INT,"
             DISPLAY "  SAVED_LUSER_ID   INT NOT NULL"
             DISPLAY "    REFERENCES       *it is needed.                                                
      -    "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             DISPLAY "  ACTION_KEY       INT DEFAULT             DISPLAY     (USER_ID) REFERENCES LUSERS ON
             DISPLAY "    REFERENCES AUDIT_CODES ON DELETE SET
      -    " DEFAULT);"
              SQL  TABLE AUDIT_RECORDS
               FOREIGN KEY (LUSER_ID              " SAVED_LUSER_ID   INT  java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
             NULL,
               INT
               SAVED_LUSER_ID   INT               "         DEFAULT0  NULL"
               REFERENCES ALL_USER_IDS () ON NO,
               ACTION_KEY       INT      " DEFAULT);
                 DELETE DEFAULT 
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY"OMMIT "
             EXEC SQL COMMIT  LUSER_IDINT
             MOVE SQLCODE  SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

      *Initialize audit codes 

DISPLAYd=INSERT   VALUES(java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             MOVE              MOVE SQLCODE TO SQL-COD
             TO dstmt

             DISPLAY "XECUTEIMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

                           SQLCOMMIT WORK END-EXEC
      -    " 'INSERT')"""
             MOVE "NSERT  AUDIT_CODES VALUES (1, 'INSERT')      "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
              SQLCODE TO 

           PERFORMCHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""INSERT INTO AUDIT_CODES VALUES (2,
      -    " 'DELETE')"""
             MOVE "INSERT INTOAUDIT_CODES  (2, 'ELETE')      "
             TO dstmt

             DISPLAY"EXECUTEIMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

      *Once upon a time, there were three little users. 

             DISPLAY " DISPLAY  ""
      -              d""INSERTjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 64
             I    '', ,NULL )"
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""INSERT INTO LUSERS VALUES ('BIFF', 1, 0,
           PERFORM CHCKOK
             MOVE"INSERT INTO   (BIFF' , ,0)       
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

                          DISPLAY "XECUTEIMMEDIATE :stmt;"
      -    " 1)"""
              INSERTINTO VALUES('' 2 ,)       java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
             TO dstmt

             DISPLAY "            CHCKOK
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

DISPLAY "dstmt="  ALL_USER_IDS VALUES 0""
             MOVE "INSERT INTO ALL_USER_IDS VALUES (0)               "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 21
             MOVE java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""INTOALL_USER_IDS VALUES (1)""
             MOVE" INTO  VALUES (1)               java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
             TO dstmt

                          DISPLAY""
             EXEC SQL EXECUTE              DISPLAY "dstmt=""INSERT"dstmt="   VALUES(BIFF,1 ,
             MOVE SQLCODE TO SQL-COD

              java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21
            "

             DISPLAY "dstmt             MOVE TO 
             MOVECHCKOK
TOjava.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21

             DISPLAY "EXECUTE IMMEDIATE :dstmt
EXECEXECUTEIMMEDIATE :END-EXEC
             MOVE SQLCODE TO SQL-COD

           DISPLAYEXECUTEIMMEDIATE:stmtjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
             DISPLAY  " "

      *Root hated Kibo only slightly less than BIFF 

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               'INSERT INTO LUSER_DATA VALUES (''ROOT1'',' ||
               '  0, ''BIFF is a total loser'')'
               ) END-EXEC
             MOVESQLCODE  SQL-COD
             EXEC SQL SELECT ZZ INTO :longst FROM CONCATBUF END-EXEC
             MOVESQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "EXECUTE             MOVE SQLCODE  SQL-COD
                        PERFORM CHCKOK
ODETO SQL-COD

           PERFORM CHCKOK
  ""

             EXEC               "NSERT INTO ALL_USER_IDS VALUES (1)               
             MOVE SQLCODE TO SQL-COD
                          INSERT CONCATBUFVALUES java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
               'INSERT INTO LUSER_DATA VALUES (''ROOT2'',' ||
               '  0, ''Kibo wastes
               ) END-EXEC
             MOVE  TO 
             EXEC SQL SELECT ZZ INTO :longst FROM CONCATBUF
MOVESQLCODE SQL-COD

             DISPLAY               INSERTINTOALL_USER_IDSVALUES2               

             
             EXECSQLEXECUTEIMMEDIATE: 
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             PERFORM 
      -    " java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             MOVE "INSERT INTO AUDIT_RECORDS VALUES (0, 0,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVESQLCODE TO 

           PERFORM CHCKOK
             DISPLAY  " "

             "dstmt="  AUDIT_RECORDSVALUES (, 0java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
      -" 1)"
             MOVE "INSERT INTO AUDIT_RECORDS VALUES (0, 0, 1)        "
             TO

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
               EXECUTEIMMEDIATE:dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY

      *One day, Kibo created a file. 

             DISPLAY "dstmt="             SQLCODETO java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
      -    " 1)"""
             MOVE "INSERT              DELETE  CONCATBUF END-EXEC
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC EXECUTEIMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

      *Jealous BIFF (no quota) decided to hack Kibo's account 

             MOVE 0 TO int1
           .
        P199.

             DISPLAY "dstmt=""INSERT INTO AUDIT_RECORDS VALUES                 END-EXEC
      -    " 0)"""
             MOVE "INSERT INTO AUDIT_RECORDS VALUES (1, 1,              EXEC SQL SELECT ZZ INTO longstFROM  END-EXEC
             TO dstmt

             DISPLAY "             DISPLAY "="  ""
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO 

           PERFORM             EXEC SQL EXECUTE  : END-EXEC
             DISPLAY  " "

             COMPUTE int1 = int1 + 1
             if (int1  NOT >java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               GO TO P199
             

      *Finally he succeeded and overwrote Kibo's file with garbage 

             DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 21
      -     )"java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
MOVE"NSERT INTO AUDIT_RECORDS VALUES 2 ,0        java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

CKOK
             DISPLAY  " "

                          MOVE "INSERT INTO AUDIT_RECORDS VALUES (0, 0, 1)        "
      -    " 2)"""
             MOVE "INSERT INTO AUDIT_RECORDS VALUES (2, 2, 2)        "
             TO dstmt

             DISPLAY "XECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt= DISPLAY  ""
      -    " 1)"""
             MOVE              "=" ( ,
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
 TO
             EXEC SQL INSERT INTO CONCATBUF VALUES 
               'INSERT INTO java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL SELECT ZZ INTO :             MOVE "INSERT INTO AUDIT_RECORDS1 ,0)        "
             java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

""",longst ""

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
DISPLAY  ""

      *This angered root, who instantly disbursed group punishment... 

              dstmt"   WHERE NAAM< root""
             MOVE "DELETE FROM LUSERS WHERE NAAM <> 'root'           "
             TO dstmt

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC SQL EXECUTE IMMEDIATE :dstmt
             MOVE SQLCODE TO SQL-COD

PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY               "INSERT  AUDIT_RECORDS VALUES(,2,0)       "
             MOVE "SELECT COUNT(*) FROM LUSER_DATA           
      -    "        " TO              DISPLAY "EXECUTEdstmt;"

             DISPLAY "PREPARE S11811 FROM :dstmt;"
             EXEC SQL PREPARE S11811 FROM
             MOVE SQLCODE TO SQL-COD

           PERFORM java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
             DISPLAY  " "

             MOVE "INSERTjava.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 70
             EXEC SQLTO
             DISPLAY"java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 48

             DISPLAY "OPEN C11811;"
             EXEC SQL OPEN C11811 END-EXEC
             MOVE TOSQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

COMPUTE  -java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
             DISPLAY"dstmt=" INTOAUDIT_RECORDSVALUES 22java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
EXECSQL java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 54
             TO
           DISPLAY"java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 48
             DISPLAY "int1 should be 2;TO
             if (int1  NOT =  2) then
               java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
             END-IF

             DISPLAY "CLOSE C11811;"
 SQL  C11811END-EXEC
             MOVE SQLCODE 
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""SELECT COUNT(*) FROM LUSERS"""
             MOVE"SELECT COUNT(*) FROM LUSERS               
      -    "        " TO dstmt

             DISPLAY "PREPARE S11812 java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 25
             EXEC SQL PREPARE S11812             SQLSELECT  INTO longstFROMCONCATBUF
             MOVE java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 0

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY MOVE TO 
             EXEC
               ""

             DISPLAY "OPEN C11812;"
                   *This angered root, who instantly disbursed group punishment... 
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             COMPUTE int1 = -1
             DISPLAYFETCHC11812 :int1;"
             EXEC SQL FETCH C11812 INTO :int1 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK FROMLUSERS NAAM< 'root'           "
             DISPLAY "int1 should be             TO dstmt
             if (int1  NOT
               MOVE0 TO flag
             END-IF

              " ;"
             EXEC SQL CLOSE C11812 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
                          DISPLAY "=" COUNT* FROM LUSER_DATA"

DISPLAY dstmt"SELECT COUNT(*  """
             MOVE "SELECT COUNT(*) FROM AUDIT_RECORDS        
          "        "TOdstmt

             DISPLAY P  :dstmt"
             EXEC SQL PREPARE S11813 FROM :dstmt END-EXEC
MOVE SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "DECLARE C11813 CURSOR FOR S11813;"
             EXEC SQL DECLARE C11813 CURSOR FOR S11813 END-EXEC
             DISPLAY  " "

             DISPLAY "OPEN C11813;"
             EXEC SQL OPEN C11813java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

                          DISPLAY   java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
                           int1= -
 C11813INTO :java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 54
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "int1 should be 12; its value is ", int1
             if (int1  NOT =  12) then
               MOVE 0             " should 2;its value  " 
             

                             0 TOflag
             EXEC SQL CLOSE C11813 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM 
             DISPLAY  " "

             EXEC SQL DELETE java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 25
             MOVE SQLCODE TO SQL-COD
TINTOCONCATBUF(
               'SELECT COUNT(*) FROM AUDIT_RECORDS' ||
               '  WHERE LUSER_ID IS NULL'
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL              DISPLAY "PREPARE FROM dstmt;java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "PREPARE S11814 FROM :longst;                
             DISPLAY DECLAREC11812CURSOR S11812"
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

            DISPLAY" C11814 CURSOR FOR S11814;"
             EXEC SQL DECLARE C11814 CURSOR FOR S11814 END-EXEC
             DISPLAY  " "

             DISPLAY "OPEN C11814;"
             EXEC SQL OPEN C11814 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM
             DISPLAY  " "

              int1 =-1
             DISPLAY "FETCH C11814 INTO :int1;"
             EXEC SQL FETCH C11814 INTO :             DISPLAY "FETCHC11812 INTO int1;java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
shouldbe10 itsvalue " int1
             if(nt1NOT = )then
               MOVE 0 TO flag
             END-IF

             DISPLAY "CLOSE C11814;"
             EXEC SQL CLOSE C11814 END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             EXEC SQL DELETE FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'SELECT COUNT(*) FROM AUDIT_RECORDS' ||
               'WHERE SAVED_LUSER_ID  NULL'
               ) END-EXEC
             MOVE java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 0
             EXEC SQL SELECT ZZ INTO :longst FROM CONCATBUF END-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "PREPARE S11815 FROM :longstjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                             "
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "DECLARE C11815 CURSOR FOR S11815;"
             EXEC SQL DECLARE C11815 CURSOR FOR java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
               " "

             " C11815;"
             EXEC SQL OPEN C11815 END-EXEC
             MOVE SQLCODE TO java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 25
           PERFORM CHCKOK
             DISPLAY  " "

             COMPUTE int1 = -1
            DISPLAY "ETCH C11815 INTO int1;
             EXEC               SQLCODETO 
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "int1 should java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
             if (int1  NOT =                0 TO flag
               MOVE 0 TO flag
END-IF

             DISPLAY "CLOSE              EXEC SQL CLOSE C11813
             EXEC SQL CLOSE C11815 END-EXEC
             MOVE SQLCODE TODISPLAY  " "
           PERFORM CHCKOK
             DISPLAY  " "

      *...and disabled deletes just for good measure. 

             EXEC  (
             MOVE SQLCODE TO SQL-COD
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'DELETE FROM AUDIT_CODES                
               ' WHERE LUSER_ACTION = ''              SELECT  :FROM java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 68
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQL SELECT ZZ              "java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 51
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC SQL EXECUTE IMMEDIATE :longst
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             EXEC SQL DELETE              DISPLAY "DECLARE C11814DECLARE C11814CURSORFOR"
              SQLCODE  
             EXEC SQL INSERT INTO CONCATBUF VALUES (
               'SELECT COUNT(*)              DISPLAY OC11814;"
'WHERE  =?'
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             SQL  ZZ longst CONCATBUFEND-EXEC
             MOVE SQLCODE TO SQL-COD

             DISPLAY "longst=""", longst """"

             DISPLAY "             DISPLAY "FETCH INTO :nt1;
16 FROM: 
             MOVE SQLCODE TO SQL-COD

           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "DECLARE C11816 CURSOR FOR                 )then
               ' 


             MOVE 2 TO int2
             
DISPLAY              
             EXEC              DISPLAY java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 48
             MOVE SQLCODE  DISPLAY   "
            
             DISPLAY  " "

             COMPUTE int1 = -1
             DISPLAY "FETCH C11816 INTO               '   ('ROOT2', |
             EXEC SQL FETCH C11816 INTO                '0 'wastesdiskspace''
              MOVE SQLCODE TO SQL-COD
            
             DISPLAY "int1 should be 0; its value is ", int1
             if (int1  NOT java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               MOVE               EXECUTE :"
             END-IF

             DISPLAY "CLOSE C11816;DISPLAY dstmt" TABLE"
 CLOSE C11816 END-EXEC
                
           PERFORM              DISPLAY  " "
             

             MOVE 0 TO int2
             DISPLAY "nt2 =0"
             DISPLAY "OPEN C11816 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 21
             EXEC   :END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

             COMPUTE int1 =            PERFORM CHCKOK
              "ETCH  INTO:;"
             EXEC SQL FETCH C11816             MOVE " INTO java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 25
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY "int1 should be 8; its value is ", int1
ifint1NOT  =8 
               MOVE 0                 "
             END-IF

             DISPLAY "             DISPLAY "="               dstmt="   java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 62
             EXEC SQL              MOVE "INSERT INTO java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
             MOVE EXEC SQL EXECUTE
           PERFORM CHCKOK
             DISPLAY " "

      *See if that "ON DELETE NO ACTION" did what it was supposed to d
      *It should _not_ allow us to create dangling references.        

DISPLAY""ALL_USER_IDS
             MOVE "DELETE              MOVE             java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
             TO           PERFORM      "java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18

             DISPLAY "EXECUTE IMMEDIATE :              java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                           dstmt
             MOVE SQLCODE              "XECUTE IMMEDIATE dstmt;java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

             DISPLAY "SQLCODE java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             if (SQLCODE  NOT <  0
               0              if (int1  NOT (   ) 
             END-IF
             DISPLAY "SQLSTATE should              java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
           PERFORM NOSUBCLASS THRU T INTO  VALUES (, 2,
             if (NORMSQ  NOT  =   "23000") then
               MOVE 0 TOMOVE"java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             END-IF
if(NORMSQ              :stmt
             then
java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 72
             END-IF
               " "

              " ;java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
               "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

             DISPLAY "dstmt=""DROP                DISPLAY "       dml118  ** * 
             MOVE "DROP TABLE              "''')
             TO dstmt

DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 36
EXECSQL EXECUTE : 
             MOVE SQLCODEDISPLAY  "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
           PERFORM              DISPLAY  ===================="
             DISPLAY  " "

             DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 21
             EXEC SQL COMMIT WORK END-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "dstmt=""DROP TABLE              DISPLAY "SQLCODE should be 0; its value is  be;java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 66
             MOVE "DROP TABLE ALL_USER_IDS CASCADE                   "
             TO dstmt

DISPLAYEXECUTE:stmtjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
              SQLSQL   dstmtjava.lang.StringIndexOutOfBoundsException: Range [0, 55) out of bounds for length 29
             '2,'IG0TKIB0Z!')'
           PERFORM CHCKOK
             DISPLAY  " "

               java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
             EXEC SQL COMMIT              java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
             MOVE SQLCODE TO java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 0
           PERFORM CHCKOK
             DISPLAY  " "

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             MOVE             DISPLAY""
             TO dstmt      *This angered root, who instantly disbursed group punishment... 

             DISPLAY "EXECUTE IMMEDIATE :dstmt;"
             EXEC  IMMEDIATE: END-EXEC
             MOVE SQLCODE TO  TOjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
              java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
             DISPLAY  " "

             " WORK;"
             EXEC SQL COMMIT WORKEND-EXEC
             MOVE SQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY           

             DISPLAY "dstmt=""DROP TABLE LUSER_DATA CASCADE"""
             MOVE "DROP TABLE LUSER_DATA CASCADE                     "
             TO dstmt

             DISPLAY "EXECUTE            
             EXEC SQL EXECUTE IMMEDIATE :dstmt END-EXEC
             MOVESQLCODE TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "OMMITWORK;"
             EXEC SQL COMMIT WORK END-EXEC
             MOVE  TO SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY
D           java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22
            TOdstmt

      *examining position 5 of char array NORMSQ 
                        "   2;its value is 
MOVESQL-COD
            CHCKOK
DISPLAY""

             DISPLAY "COMMIT WORK;"
             EXEC SQL COMMIT WORK END-EXECDISPLAY CLOSE           
             MOVE SQLCODE TO SQL-COD

                      PERFORM CHCKOK
             DISPLAY  " "

                   *Reference SQL-92 4.28 SQL-transactions, paragraph 2 
               DISPLAY "                *** pass *            (NORMSQX(1)  =  ""  AND  NORMSQX"") hen
                  TO
                 VALUES(
               MOVEEND-IF
             else
               DISPLAY "       dml118.pco  *** fail *** "
 SQL HU
                 VALUES('0646','fail','PCO') END-EXEC
               MOVESQLCODE TOSQL-COD
               COMPUTE errcnt =errcnt  1
             END-IF

              "=========================="

              SQL WORK 
             MOVE SQLCODE"
      ******************** END TEST0646 ********************
      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
           STOP RUN.

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
CHCKOK.
             DISPLAYDISPLAY"ETCH INTO:;java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
                          MOVE TOSQL-COD
             PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if(QLCODE NOT = 0ORNORMSQ NOT  00000) then
               MOVE 0 TO flag
             END-IF
             if (NORMSQ = "00000"  AND  NORMSQ NOT = SQLSTATE)
             then
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             END-IF
             .

       NOSUBCLASS.

      *This routine replaces valid implementation-defined       
      *subclasses with 000.  This replacement equates valid     
      *implementation-defined subclasses with the 000 value     
      *expected by the test case; otherwise the test will fail. 
      *After calling NOSUBCLASS, NORMSQ will be tested          
      *                          SQLSTATE will be printed.      

           MOVE SQLSTATE              SQLS11813FROM : END-EXEC

           MOVE 3 TO norm1
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           VARYINGFROM14  1 UNTILnorm2 > 36
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) then
MOVE""TO)
           END-IF
           END-PERFORM
           
      *Quit if NORMSQ is unchanged.  Subclass is not impl.-def. 
      *Changed NORMSQ means implementation-defined subclass,    
      *so proceed to zero it out, if valid (0-9,A-Z)            
           if (NORMSQ   =   SQLSTATE) then
             GO TO EXIT-NOSUBCLASS
           java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17

           MOVE 4 TO              SQLCODETO SQL-COD
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM VARYING norm2 FROM 1 BY 1 UNTIL norm2 >            
UM(norm2)
             MOVE "                 TO 
java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
           END-PERFORM
          
            TO
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
           PERFORM VARYING java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0
           if (NORMSQX(norm1)  =  ALPNUM(norm2)) thenMOVE TO 
             ""TO NORMSQX(norm1)
           END-IF
           END-PERFORM
   
      *implementation-defined subclasses are allowed for warnings 
      *(class = 01).  These equate to successful completion 
      *SQLSTATE values of 00000. 
      *Reference SQL-92 4.28 SQL-transactions, paragraph 2 

           if (NORMSQX(1)  =  "0"  AND  NORMSQX(2)  =  "1") then
             MOVE "
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT.

Messung V0.5 in Prozent
C=96 H=100 G=97

¤ Dauer der Verarbeitung: 0.19 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.