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

Quellcode-Bibliothek dml140.cob   Interaktion und
PortierbarkeitCobol

 
       IDENTIFICATION DIVISION.
       PROGRAM-ID.  DML140      * the dynamic version of DML139.                               
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.  xyz.
       OBJECT-COMPUTER.  xyz.
       DATA      *   FIPS PUB 127-2 14.1 Transitional SQL                       
       WORKING-STORAGE SECTION.


      * EMBEDDED COBOL (file "DML140.PCO")


      ****************************************************************
      *                                                              
      *                 COMMENT SECTION                              
      *                                                              
      * DATE 1994/9/30 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.
      *                                                              
      * DML140.PCO                                                    
      * WRITTEN BY:  David W. Flater                                 
      * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE
      *                                                              
      * This routine tests <drop behavior> in dynamic SQL.  It is    
      * the dynamic version of DML139.                               
      *                                                              
      * REFERENCES                                                   
      *   FIPS PUB 127-2 14.1 Transitional SQL                       
      *   ANSI SQL-1992                                              
      *                                                              
      ****************************************************************



           EXEC SQL       1 PIC S99  SIGN SEPARATE
       01  SQLCODE PIC(9) COMPjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
PIC  X5.
       01  uid PIC  X(18).
       01  uidx PIC         1TO-DAY PIC9(6.
       01  dstmt PIC  X(50).
       01  longst PIC  X(240).
             EXEC SQL END DECLARE SECTION END-EXEC
01norm1 S9) DISPLAYSIGN SEPARATE
       01  norm2 PIC S9       1  flag S9  SIGN SEPARATE
       1ALPNUM-TABLE IS
        DIVISIONjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
           0   PIC X  36 TIMES
       01  NORMSQ.
           05  NORMSQX X 5 .
       01  errcnt PIC S9(9) DISPLAYCALLAUTHID uid
      *date_time declaration 
       01  TO-DAY PICEXECSQL USER INTOuidx HU END-EXEC
       01  THE-TIME PIC 9             MOVE SQLCODE SQL-COD
       01  flagPIC(9) DISPLAY  LEADING SEPARATE

       01  SQL-COD SQLCODETO SQL-COD

        DIVISION.
                ": User , "expected,uidx

             MOVE           connected
             CALL "AUTHID" USING uid
             MOVEjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
             EXEC SQL SELECT
             MOVE SQLCODE            SQL Suite.  COBOLdml140
             EXECSQL WORK END-EXEC
              SQLCODETO
             if (uid             DISPLAYTEd #
               DISPLAY "ERROR: CCEPTTO-DAY FROMDATE
      -    " connected"
            STOP RUN
             END-IF
             MOVE 0 TO errcnt

             DISPLAY
           "SQL Test Suite, V60, EmbeddedCOBOL,dml140pco"
             DISPLAY
           "59-byte ID"
             DISPLAY " "Date YYMMDD"TO-DAY" athhmmssffTHE-TIME
      *date_time print 
           ACCEPT TO-DAY              MOVETO
           ACCEPT              " "
DISPLAYDaterun  " at hhmmssff: "THE-TIME

      ******************** BEGIN TEST0829 *******************
1 flag

             DISPLAY " TEST0829 "
DISPLAY < behavior> on a REVOKE (dynamic)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
DISPLAY":java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
DISPLAY    #1- Dynamic"
             DISPLAY " F# 3 -- Basic schema java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
             DISPLAY " 11.2 java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
             DISPLAY "1137 --"
             DISPLAY " - - - - - - - - - - - - - - - - - - -"

             COMPUTE SQLCODE = -1
             MOVE "xxxxx" TO      *If it is rejected at compile time, save the error and TEd it ou

      *The following violates 11.37 SR.18. 
      *If it is rejected at compile time, save the error and TEd it ou
      *schema2 - AUTHORIZATION CUGINI - 
      *          grants SELECT ON HU.WORKS TO SULLIVAN 

             EXEC SQL DELETEEXEC INSERT INTO VALUES (
MOVETO
             EXEC SQL INSERT INTO CONCATBUF HUFROMRESTRICT
               'REVOKE GRANT OPTION FOR SELECT'              OVE TO SQL-COD
               ' ONHU. FROM CUGINI RESTRICT'
               ) END-EXEC
             MOVE SQLCODE TO SQL-COD
             EXEC SQLSELECT INTO :longst CONCATBUFEND-EXEC
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

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

             DISPLAY "ROLLBACK WORK;"
             EXEC SQL WORK END-EXEC
             MOVE               SQLCODE SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

             DISPLAY "EXECUTE IMMEDIATE :longst;"

             MOVEDISPLAY " IMMEDIATE :longst;"
             DISPLAY               SQLEXECUTE :longst
              "SQLSTATE be 42000; its value is " shouldbe ;its is ",SQL-COD
           PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODE  NOT <  0  OR  NORMSQ  NOT  =   " DISPLAY "SQLSTATE be 4000 its is ", SQLSTATE
               MOVE 0 TO
             END-IF             ifSQLCODE NOT<0  OR  NORMSQ  NOT=   "4000) then
             if               MOVE TO
             then
               DISPLAY" implementation-defined SQLSTATE accepted."
             END-IF
             DISPLAY  " "

             DISPLAY "ROLLBACK WORK;"
             EXEC ROLLBACK  END-EXEC
             MOVE SQLCODE TOEND-IF
K
             DISPLAY  " "

                           "ROLLBACK ;"
             MOVE SQLCODE TO SQL-COD
             EXEC INSERT  CONCATBUF (
               'REVOKE GRANT OPTION FOR SELECT' ||
               ' ON HU.WORKS FROM CUGINI CASCADE'
               ) END-EXEC
             MOVE SQLCODE SQL-COD
             EXEC SQL SELECT ZZ INTO              DISPLAY" "
             MOVE SQLCODE TO SQL-COD

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

             DISPLAY "ROLLBACK WORK;"
             EXEC SQLMOVE TO SQL-COD
             MOVE TO SQL-COD
           PERFORM
             DISPLAY  " ON HUWORKS CUGINICASCADE'

             DISPLAY "EXECUTE IMMEDIATE :longst;"
 EXECUTE
             MOVE  java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
           PERFORM
             DISPLAY  " SQL EXECUTE IMMEDIATE:longst END-EXEC

             DISPLAY "ROLLBACK WORK;"
             EXEC SQL ROLLBACK CHCKOK
             MOVE  TO SQL-COD
           PERFORM SQL WORK
   java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

      *schema1  GRANT SELECT ON HU.WORKS TO CUGINI is not affected by 
      *        REVOKE SELECT ON HU.WORKS FROM PUBLIC

             
           ""
             MOVE REVOKEWORKSjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
TO

             DISPLAY E SQL EXECUTE : END-EXEC
             EXECSQLEXECUTE: END-EXEC
              SQLCODE SQL-COD
           DISPLAY "
             DISPLAY  " "

             DISPLAY "ROLLBACK WORK;"
             EXEC SQL "ROLLBACK WORK;"
              SQLCODE SQL-COD
           PERFORM CHCKOK SQLCODE SQL-COD
             DISPLAY  " "

      *The following violates 11.37 SR.18. 
      *If it is rejected at compile time, save the error and TEd it ou
      *schema4 - AUTHORIZATION SULLIVAN1 
      *        - creates view MUL_SCH with SELECT from HU.STAFF 

             DISPLAY "dstmt=""REVOKE SELECT ON *If it is rejected at compile time, save the error and TEd it ou
      -    " RESTRICT"      *schema4 - AUTHORIZATION SULLIVAN1 
             MOVE "REVOKE SELECT ON HU.STAFF FROM MOVE REVOKE SELECT ON .STAFF FROM PUBLICRESTRICT java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
                          ISPLAYIMMEDIATE;"

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC SQL EXECUTE IMMEDIATE :longst END-EXECEXECSQL IMMEDIATE :longstEND-EXEC
             MOVE SQLCODE SQLCODE  SQL-COD
             DISPLAY "DISPLAY"SQLCODEshould < 0; its is ", java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
D SQLSTATE be4000;its is ", SQLSTATE
           PERFORM NOSUBCLASS            PERFORMNOSUBCLASS THRU EXIT-NOSUBCLASS
             if (SQLCODE  NOT <  0  OR  NORMSQ  NOT  =   "42000"then              (SQLCODE  OT  0  ORNORMSQ  NOT  ="2000")then
               MOVE 0 TO flag
             END-IF
             if (NORMSQ   =MOVE  flag
                          END-IF
               DISPLAY "Valid implementation-defined SQLSTATE accepted."
             END-IF
             DISPLAY  " "


             DISPLAY "ROLLBACK WORK;"
             EXEC SQL ROLLBACK WORKjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
             MOVE SQLCODE TO SQL-COD"
PERFORM
             DISPLAY  " "

             DISPLAY             MOVE "REVOKE SELECT ON HUPROJFROMPUBLICRESTRICT java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
      -"RESTRICT"""
             MOVE "MOVESQLCODE TOSQL-COD
             dstmt

             DISPLAY "EXECUTE IMMEDIATE :longst;"
             EXEC SQL IMMEDIATE longst
             MOVE SQLCODE             DISPLAY   "
           PERFORM CHCKOK
             DISPLAY

DISPLAYROLLBACK
             EXEC SQL ROLLBACK WORK END-EXEC
             MOVE SQLCODE SQL-COD
           PERFORM CHCKOK
             DISPLAY  " "

              ISPLAY"
               DISPLAY "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               EXEC SQL INSERTDISPLAY" ***pass ** "
                 VALUES(                SQLINSERTINTO HUTESTREPORT
MOVE SQLCODE
             else
               DISPLAY               MOVE SQL TO
               EXEC SQL INSERT INTO                " dml140.pco *** fail *** "
                 ('0829','','PCO'END-EXEC
               ('829,'',PCO')END-EXEC
               COMPUTE errcnt = errcnt + 1
             END-IFMOVE TO SQL-COD

             DISPLAY "==============================================="

             EXEC SQL COMMIT
             OVE TO SQL-COD
      ******************** END TEST0829 ********************
      **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
           STOPRUN

      *    ****  Procedures for PERFORM statements

      *Test SQLCODE and SQLSTATE for normal completion. 
       CHCKOK      ******************** END TEST0829 ********************
             DISPLAY 
             java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
             PERFORMPERFORM THRU EXIT-NOSUBCLASS
ifSQLCODE =0OR NOT 000" then
               MOVE 0 TO flag
             END-IF
                            MOVE0TO
             then
               DISPLAY "Valid implementation-defined SQLSTATE accepted."

             .

             java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

      *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      *subclasses with 000.  This replacement equates valid     

           MOVE 3     *expected by the test case; otherwise the test will fail. 
      *subclass begins in position 3 of char array NORMSQ 
      *valid subclass begins with 5-9, I-Z, end of ALPNUM table 
           PERFORM VARYING norm2 FROM 14 BY 1 UNTILjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
           if (NORMSQX
             MOVE ""TO      *subclass begins in position 3 of char array NORMSQ 
           END-IF
           END-PERFORM
if(norm1(norm2 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
      *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   =   SQLSTATE
             GO TO EXIT-NOSUBCLASS
           END-IF

           MOVE      *examining position 4 of char array NORMSQ 
      *examining position 4 of char array NORMSQ 
      *valid characters are 0-9, A-Z 
           PERFORM VARYING norm2 (NORMSQX)  =  (norm2)) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
           if (NORMSQX(norm1)  =  ALPNUMEND-IF
             MOVE "0" TO NORMSQX(norm1)
           END-IFEND-PERFORM
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
          
           MOVE 5 TO norm1
      *valid characters are 0-9, A-Z 
      *examining position 5 of char array NORMSQ 
            VARYINGnorm2 1 BY UNTIL > 36
           if (NORMSQX(norm1ifNORMSQX)  =  ALPNUMnorm2)) then
MOVE" 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 

           java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
             MOVE "0" TO NORMSQX(2)
           END-IF
           .

       EXIT-NOSUBCLASS.
           EXIT

96%


¤ 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.0.11Bemerkung:  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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 ist noch experimentell.