. PROGRAM-ID. DML142. ENVIRONMENTDIVISIONjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 CONFIGURATIONSECTION. SOURCE-COMPUTER. xyz. OBJECT-COMPUTER. xyz. DATADIVISION* DATE 1994/11/1 EMBEDDED COBOL LANGUAGE WORKING-STORAGESECTION.
* EMBEDDED COBOL (file "DML142.PCO")
**************************************************************** * * COMMENT SECTION * * DATE 1994/11/1 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. * * DML142.PCO * WRITTEN BY: David Flater * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests privilege violations by user HU and * cursor operations on tables with duplicate rows. * * REFERENCES * ANSI SQL-1992 * ****************************************************************
EXECSQL BEGIN DECLARE SECTIONEND-EXEC 01SQLCODEPIC S9(9) COMP. * 01 uid PIC X(18). 01 uidx PIC X(18). 01 int1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. 01 c10 PIC S9(9) DISPLAYSIGN* NIST assumes no responsibility for any party's use of 01 c12 PIC S9(9) * DML142.PCO 01 c13 PIC S9(9) DISPLAYSIGN 01 cxx PIC S9(9) DISPLAY"ELETE FROM FLATER.USIG;" SQLENDDECLARESECTIONEND-EXEC 01 norm1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. PIC )SIGNSEPARATEjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 01ALPNUM-TABLE "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ". 05PERFORMNOSUBCLASSTHRUEXIT-NOSUBCLASS 01 . 05 NORMSQX PIC X OCCURS5 TIMES. 010 *date_time declaration 01 TO-DAYifN "AND NORMSQ NOT = SQLSTATE) 01 THE-TIME PIC9(8). 01 flag PIC S9DISPLAYValidimplementation-definedSQLSTATE accepted"
01 SQL-COD DISPLAY java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
EXECSQLROLLBACKWORKEND-EXEC
P0.
MOVE"HU "TOPERFORM CHCKOK CALL"AUTHID"USINGif flag =1then MOVE"not logged in, not"TO uidx EXECSQLSELECT USER : FROM HU.ECCO END-EXEC MOVESQLCODE SQL-COD EXECSQLMOVESQLCODETO SQL-COD MOVESQLCODETO SQL-COD
(id NOT uidx)then DISPLAY"ERROR: User ", uid " expected. User ", uidx "
- " connected" STOPRUN END-IF MOVE0TO errcnt
DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, dml142.pco" DISPLAY "59-byte "alidimplementation-defined SQLSTATE accepted. DISPLAY"TEd Version DISPLAY " *date_time print ACCEPT TO-DAYFROMDATE TIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME PERFORM CHCKOK
******************** BEGIN TEST0527 *******************
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 27
DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 DISPLAY" Priv. violation: ('0527''pass,PCO)END-EXEC DISPLAY java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 DISPLAY" 6EXEC INTO .ESTREPORT DISPLAY" - - - - - - - - - - - - - - - - - - -"
COMPUTESQLCODE = -1 SQLCODETO SQL-COD
*Select
COMPUTE int1 = -1
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 SELECTCOUNT()INTOint1 FROM FLATER.SIG END-EXEC MOVESQLCODETO SQL-COD DISPLAYMOVESQLCODETO SQL-COD DISPLAY"QLSTATE be 42000;its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT < 0OR NORMSQ NOT = "42000") then
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0 END-IF if( = ""NOT= ) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY"nt1 should NOT be 2; its value is ", int1 if (int1 = 2) then MOVE0 flag END-IF
*Insert
DISPLAY"INSERT INTO FLATER.USIG VALUES (2,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 EXECSQLINSERTINTO .USIGVALUES(, 4END-EXEC MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be < 0; its value is ", SQL-COD DISPLAY"SQLSTATE should be 42000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVE0TO flag END-IF if (NORMSQ = "42000" java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 40 then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF ""
*Update
DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 EXECSQL UPDATE FLATER.USIG SET C1 DISPLAY" EMPNUM, GRADE,CITY STAFFjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be < 0; its value is ", SQL-COD valueis", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT < 0ORWHERE GRADE = 12END-EXEC MOVE0TO flag END-IF if(ORMSQ= "2000 AND NORMSQNOT = SQLSTATE) then DISPLAY"Valid implementation-defined java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 END-IF DISPLAY""
*Delete
FLATER" EXECSQLDELETEFROM SQLCODE SQL-COD DISPLAY"SQLCODE should be < 0
TEshould be ;its value", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS PERFORMCHCKOK MOVEjava.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 25 END-IF if (NORMSQ = "0
if (flagGOP102 DISPLAY *** * java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 INSERTINTO HUTESTREPORT
VALUES'''ass''')END-EXEC MOVE COMPUTE c10 +java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 else DISPLAY" dml142.pco *** fail *** " EXECSQLINSERTINTO HU.TESTREPORT
VALUES'''fail''PCO'END-EXEC MOVESQLCODETO SQL-COD COMPUTE errcnt = errcnt + 1
EXECSQLCOMMIT WORK java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 19 MOVESQLCODETO SQL-COD DISPLAY"======== +java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
******************** END TEST0527 ******************** ******************** BEGIN TEST0528 ******************* MOVE1TO flag
DISPLAY" TEST0528 " DISPLAY" Tables are if (SQLCODE NOT = 100 OR 02000)then
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 " DISPLAY" - - - - - - - - - - - - - - - - - - -"
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 MOVE""TOSQLSTATE
DISPLAY D" EXECSQLDELETEDISPLAY"Count of 10s should be 1; its value is ", c10 MOVE DISPLAY 12 shouldbe;its " c12
DISPLAY"INSERT INTO TEMP_S" DISPLAYSELECTEMPNUM GRADE, FROM STAFF" EXECSQLINSERTINTO TEMP_S
TEMPNUM,GRADE,CITYFROM MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"INSERT INTO TEMP_S" DISPLAY" SELECT EMPNUM, GRADE, CITY FROM STAFF" DISPLAY" WHERE GRADE = 12;" EXECSQLINSERTINTO TEMP_S SELECT EMPNUM, GRADE, CITY 0TO DISPLAYCLOSEC14221" MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"DECLARE PERFORM "SELECT GRADE ;" EXECSQL DECLARE C14221 CURSOR FOR DISPLAY"ECLARE java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 48
AY" ;java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 EXECSQLOPENC14221 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK SQLC14222 END-EXEC
MOVE0TO c10 MOVE0TO c12 MOVE0TO c13 COMPUTEint1=-
.
P101. COMPUTE int1 = -1 INTO :int1;java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 EXECSQL FETCH C14221 INTO :int1 END-EXEC MOVE TOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if (SQLCODE (nt1NOT=10) GOTO P102 END-IF DISPLAY"int1 is =-java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
(nt1 = 10then COMPUTE c10 = c10 + 1
if (int1 = 12) then COMPUTE c12 = c12 + 1 END-IF
( 13then COMPUTE c13 = c13 + 1 END-IF if (int1 NOT = 10AND int1 NOT = 12AND int1 NOT = 13) then 1 END-IF GOTO P101
.
P102. CODEshould 100; "SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE DISPLAY int1 should be12 itsvalueis , int1
(QLCODE NOTOR NORMSQ = "02000"then MOVE0TO flag END-IF END-IF
DISPLAY"Valid COMPUTE int1 = -1 END-IF DISPLAY"Count of 10s should be 1; EXECSQL INTO :nt1 " 12s be 4;its is , c12 DISPLAY"Count of 13s should be 2; its value is ", c13
othersbe;itsvalue ,cxx if (c10 NOT = 1OR c12 NOT = 4) thenDISPLAYishould be; itsvalueis" int1 MOVE0TO flag END-IF if (c13 NOT = 2OR cxx NOT = 0COMPUTE int1=- 0TO flag END-IF
DISPLAY"OPEN C14222; java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36 EXECOPENC14222END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAYMOVE0TO
COMPUTE int1 = -1
EXECSQL COMPUTE int1 = MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 10; its value is MOVE SQLCODE TO SQL-COD if (int1 NOT = 10) then MOVE0TO flag END-IF
COMPUTE int1 0TO flag DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222DISPLAY ; MOVESQLCODETO SQL-COD PERFORM CHCKOK PERFORMDISPLAY" if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVE0TO flag END-IF
COMPUTE int1 =1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 12; its java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 12 if (int1 NOT = 12)then MOVE0TO flag END-IF
COMPUTE C14221: END-EXEC DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC DISPLAYof" TOP104 DISPLAY"int1 should be 12; its value is ", int1 if (int1 NOT = 12) then MOVE0TO flag END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAYEND-IF if (int1 NOT = 12) then
java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 29
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;"
. MOVESQLCODETO SQL-COD PERFORM CHCKOK is", int1 if (int1 NOT = 13) then MOVE0TO java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 13; its value is ", int1 if (int1 NOT = 13) then MOVE0TO flag END-IF
DISPLAY"OPEN C14221;java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 EXECSQLOPEN C14221 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
MOVE java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
.
P103. COMPUTE int1 = -1 DISPLAY" 1 EXECSQL FETCH C14221 INTO :int1 " C14221 :nt1" MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) then PERFORM S NOT0 DISPLAY" of . GOTO P104 END-IF "int1 is " int1 if (int1 = 12) then GOTO P105 END-IF COMPUTE cxx = cxx - 1 if (cxx > 0) then GOTO P103 END-IF DISPLAY"Error -- should java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 19 DISPLAY"Skipping remainder of java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 36 GOTO P104
.
P105. DISPLAY"DELETE FROM TEMP_S WHERE CURRENT OF C14221;" EXECSQLDELETEFROM TEMP_S WHERE CURRENT OF C14221 END-EXEC MOVESQLCODETO P107. PERFORM CHCKOKDISPLAY" 100;itsvalue " java.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68 DISPLAY" "
.
P106. COMPUTE int1 = -1 DISPLAY"FETCH C14221 INTO :int1;" EXECSQL FETCH C14221 INTO : (13NOTORNOT =0)then MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) then GOTO P107EXECSQLCLOSE C14221 END-EXEC END-IF
CHCKOK
(int1=10then
END-IF if COMPUTE c12 = c12 + MOVESQLCODETOSQL-COD END-IF if (int1 = 13) then COMPUTE c13 = c13 + int1 =-
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 19 if(nt1NOT =10AND int1 NOT=12ANDint1 NOT = 13) java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36 COMPUTEcxx java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 END-IF
P106
.
P107. DISPLAY"SQLCODE should be 100; its value is ", SQL-COD
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if(QLCODENOT= 100ORNORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE MOVESQLCODE SQL-COD then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY"Count of 10s should be 1; its value is 0TO flag DISPLAY"Count of 12s should be 3; its value is ", c12 DISPLAY"Count of 13s should be 2; its value is ", c13 DISPLAY"Count of others should be 0; its value is ", cxx if (c10 NOT = 1OR c12 NOT = 3) then
g END-IF if (c13 NOT = 2ORjava.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 25 MOVE0TO flag END-IF
DISPLAY"CLOSE C14221;" EXECSQLCLOSEC14221 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOKEXECSQL FETCH C14222 INTO: END-EXEC DISPLAY" "
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY"OPEN C14222;" EXECSQLOPEN C14222 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" =1
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTOPERFORMjava.lang.StringIndexOutOfBoundsException: Range [25, 26) out of bounds for length 25 MOVESQLCODETO SQL-COD PERFORM CHCKOK
shouldbe;value ,int1 if (int1 NOT = 10) "ETCH :;java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 MOVE0TO flag END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 12; its value is ", int1 if (int1 NOT = 12) then MOVE0TO flag END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if (int1 NOT = 12) then MOVE0TO flag END-IF
COMPUTE . DISPLAY"FETCH C14222 :nt1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 12; its value is ", int1 if (int1 NOT = 12) then MOVE0TO flag END-IF
COMPUTE int1 = -1 DISPLAYTOP109 EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 13; its value is ", int1
cxx=cxx 1 MOVE0TO flag END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 13; its value is ", int1 if (int1 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MOVE4TO cxx
.
P108. COMPUTEint1 = -1 DISPLAY"FETCH C14221 INTO :int1;" SQLFETCH C14221 INTO :int1 END-EXEC MOVE if(QLCODE 0)then PERFORM CHCKOK DISPLAY"Skipping remainder of subtest." GOTO P109 END-IF DISPLAY"int1 is ", int1 if (java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0 GOTO P110 END-IF COMPUTE cxx = cxx - 1 if(xx> 0)then GOTO P108 END-IF DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 13 DISPLAY"Skipping remainder of java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 47 GO P109
.
P110. DISPLAY"UPDATE TEMP_S SET GRADE = 13 SQLCODENOT=0 java.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40
- " C14221;" EXECSQL UPDATE TEMP_S SET GRADE = 13 java.lang.StringIndexOutOfBoundsException: Range [0, 56) out of bounds for length 34
C14221 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
.
P109. DISPLAY"CLOSE C14221;"
SQL C14221 MOVESQLCODE PERFORM CHCKOK DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
DISPLAY"OPEN C14221;" EXECSQL java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 13 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
if NOTORNORMSQ ="" MOVE0TO c12 MOVE0TO c13 MOVE0TOcxx
.
P111. COMPUTE int1 = -1 DISPLAY"FETCH C14221 INTO :int1;" EXECSQL FETCH C14221 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD if(SQLCODENOT0)then GOTO P112 END-IF DISPLAY"int1 is ", int1 if (int1 = 10) then COMPUTE c10 = c10 + 1 END-IF
= 12)then COMPUTE c12 = c12 + 1 END-IF if (int1 = 13) then if(c13 NOT = 3NOT = ) then END-IF if (int1 NOT = 13) then COMPUTE cxx = cxx + 1 END-IF GOTO P111
.
P112. DISPLAY"SQLCODE should be 100; its value is ", SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 100OR NORMSQ NOT = "02000") then MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAYCountof10s be1;itsvalue , c10 DISPLAY"Count of 12s should be 2; its value is ", PERFORM CHCKOK DISPLAY"Count of 13s should be 3; its value is ", java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 0
FETCHjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 47 if (c10 NOT = 1OR c12 NOT = 2) then MOVE0TO flag END-IF if (c13 NOT = 3OR cxx NOT = 0) then MOVE0TO java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 10; its value is ", int1 if (int1 NOT = 10) then MOVE0TO flag END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 12; its value is ", int1 if (int1 NOT = 12) then MOVE0TO flag END-IF
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
FETCH ; EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 12; its value is MOVE SQLCODE TO SQL-COD if (int1 NOT = 12) then 0TOjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 30 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 13; its value is ", int1 if (int1 NOT = 13) then MOVE int1should13its" END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM DISPLAY"int1 should be 13; its value is ", int1 if (int1 NOT = 13) then MOVE0TO flag END-IF
"ROLLBACK WORK;" DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 13; its value is ", int1 if (int1 NOT = 13) then MOVE0TO flag END-IF
ifflag )java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
DISPLAY=========================java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 EXECSQLINSERTINTO HU.TESTREPORT
VALUES('0528','pass','PCO') END-EXEC MOVESQLCODETO SQL-COD else DISPLAY" dml142.pco *** java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 0 EXECSQLINSERTINTO HU.TESTREPORT
VALUES('0528','fail'"SQLCODE should be 0;itsvalue is",SQL-COD MOVESQLCODETO SQL-COD COMPUTE errcnt = errcnt + 1 END-IF EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD DISPLAY"================================================"
******************** END TEST0528 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK. DISPLAY"SQLCODE should be 0; its value is ", SQL-COD DISPLAY"SQLSTATE should be 00000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 0OR*After calling NOSUBCLASS, NORMSQ will be tested MOVE0TO flag END-IF if (NORMSQ = "00000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid implementation-defined SQLSTATE accepted." 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. *Quit if NORMSQ is unchanged. Subclass is not impl.-def. MOVE*Changed NORMSQ means implementation-defined subclass,
MOVE3TO N =SQLSTATE java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42 *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING norm2 FROM14BY1UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) 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 ( *valid characters are 0-9, A-Z GOTO EXIT-NOSUBCLASS
MOVE4TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 FROM1BY1UNTIL norm2END-PERFORM if*implementation-defined subclasses are allowed for warnings MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
*valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36
EXIT-NOSUBCLASS. MOVE"0"TO . 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"0"TO NORMSQX(2) END-IF
.
EXIT-NOSUBCLASS. EXIT.
Messung V0.5 in Prozent
¤ 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.24Bemerkung:
¤
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.