**************************************************************** * * 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( 01 SQLSTATE PICX()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
()java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 01 uidx PIC X(18). 01 int1 c139DISPLAY. 01 c10 PIC S9(9) DISPLAYPICS9()DISPLAYSIGNLEADINGSEPARATE.
S9(9)DISPLAYSIGNLEADING . 01c13 S99DISPLAYLEADINGSEPARATE. 01 cxx PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. EXECSQLEND DECLARE SECTION01VALUEIS 05 ALPNUMPIC X OCCURS36 TIMES. 01 NORMSQX PICOCCURS5 TIMES. 01 errcnt PIC java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 58 "01234 01 TO-DAY PIC 9(6 05 ALPNUM PIC X OCCURS36 TIMES. 01 NORMSQ. 05 NORMSQX PIC X OCCURS5 TIMES. 01 errcnt PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. *date_time declaration 01 TO-DAY PIC9(6). 01 THE-TIME PIC9(8). 01 flag PIC S9(9) DISPLAYSIGNLEADINGSEPARATE.
01java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PROCEDUREDIVISION.
P0.
MOVE"HU "TO uid CALL"AUTHID"USING uid MOVE"not logged in, not"TO uidx EXECSQL USERINTO uidxFROM .ECCO END-EXEC MOVESQLCODETO SQL-COD EXECSQLROLLBACK WORK END-EXEC MOVESQLCODETO SQL-COD if (uid NOT = uidx) then SQLSELECTINTO:uidx FROM HU. END-EXEC
STOPRUN END-IF MOVE0TO errcnt
DISPLAY "SQL Test (idNOT = uidx) then DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print ACCEPT TO-DAY FROMDATE ACCEPT THE-TIME FROMTIME DISPLAY"Date run YYMMDD: " TO-DAY "
******************** BEGIN TEST0527 ******************* MOVE1TOflag
DISPLAY" TEST0527 " DISPLAY" Priv.violation: HU" *date_time print DISPLAY" 6.3 AR.1 -- Access rule violation
- - - - - - -- - -java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
COMPUTE******************** BEGIN TEST0527 ******************* MOVE
*Select
COMPUTE DISPLAY " violation HU" DISPLAY"SELECT DISPLAY " 6.3 AR.1 Access rule violation" EXECSQLSELECTCOUNT(*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 END-EXEC MOVESQLCODEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAYSQLCODEshouldbe 0 , DISPLAY"SQLSTATE should be 42000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT < 0OR NORMSQ NOTEND-EXEC
END-IF if (NORMSQ = "QLSTATE should be 42000; its value is ", SQLSTATE then
implementation-defined SQLSTATE accepted." END-IF DISPLAY"int1 should NOT be 2; its value is ", int1 if (int1 = 2) then MOVETOflag END-IF
*Insert
DISPLAY"INSERT INTO FLATER.USIG VALUES (2, 4);" EXECSQLINSERTINTO FLATER.USIG VALUES ( DISPLAY"alid implementation-defined SQLSTATE accepted." MOVESQLCODETO SQL-COD DISPLAY"SQLCODE should be < 0; its value is ", SQL-COD DISPLAY SQLSTATE should be 42000; its valueis", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
*Insert END-IF if (NORMSQ = "42000"AND NORMSQ NOT = SQLSTATE) then
Validimplementation-defined SQLSTATE accepted" END-IF DISPLAY" "
*Update
DISPLAYDISPLAY"QLSTATE should be 42000; its value is ", SQLSTATE EXECSQLif(QLCODENOT42000) MOVETO DISPLAY"SQLCODE should be < 0; its value is ", SQL-COD DISPLAYif(ORMSQ=""AND NORMSQ NOT SQLSTATE) PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
LCODENOT <0OR NORMSQNOT42000) MOVE0TO flag END-IF if (java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 14 then DISPLAY"Valid EXEC UPDATEFLATER..USIG =0END-EXEC END-IF DISPLAY" "
*Delete
"DELETE FROM FLATER.USIG;" DELETEEND-EXEC MOVE SQL-COD DISPLAY"SQLCODE should be < 0; its value is ", SQL-COD DISPLAY PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODE MOVE0TO flag END-IF if java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 then DISPLAY V . END-IF DISPLAY" "
DISPLAY"ROLLBACK WORK;"
MOVESQLCODETO ACCEPT THE-TIME FROM
DISPLAY" "
DISPLAY" *** EXECSQLINSERTINTO HU.TESTREPORT
VALUES0527'''' MOVESQLCODETO SQL-COD else DISPLAY" dml142.pco *** fail *** " SQLINSERT HU.java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
VALUES('0527','fail','PCO') END-EXEC MOVE java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0 END-IF EXEC EXEC SQL * : .java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
DISPLAY"===== Sshould 42000 java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 72
if (SQLCODE NOT < 0 OR NORMSQ NOT = "42000") then ******************** BEGIN TEST0528 ******************* MOVE1TO flag
DISPLAY" TEST0528 " DISPLAYif NORMSQ 42000AND NORMSQ = SQLSTATEjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 DISPLAY"References:" DISPLAY" ijava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 64 DISPLAY" - - - - - - 0TOjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
COMPUTESQLCODE = -1
FLATER 2 )
DISPLAY"DELETE FROM TEMP_S;" EXECSQLDELETEFROM TEMP_S END-EXEC MOVE
DISPLAY"INSERT INTO TEMP_S" DISPLAY" SELECT java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 19 EXECSQLINSERTINTO TEMP_S SELECT EMPNUM, MOVESQLCODETO SQL-COD DISPLAY *Update
DISPLAY"INSERT INTO TEMP_S" SELECTEMPNUM FROM" DISPLAY" WHERE GRADE = 12;" EXECSQLINSERTINTO TEMP_S SELECT EMPNUM, GRADE, CITY FROM DISPLAY "SQLSTATE should be 42000; its
java.lang.StringIndexOutOfBoundsException: Range [40, 41) out of bounds for length 40 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY N ""AND java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
.
P101. COMPUTE int1 DISPLAY"FETCH C14221 java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 EXECSQL FETCHC14221INTO int1END-EXEC MOVESQLCODETO SQL-COD if TO P102 " * pass**" EXECSQL HU.
(0527,pass,PCO
= c10 +1 END-IF if (java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 17 COMPUTE c12 = c12 + 1 END-IF if (int1 = 13) VALUES('0527','fa(0527,,' COMPUTEEND-IF END-IF if (int1 NOT = 10AND int1 NOT = 12AND int1 NOT = 13) then COMPUTEcxx =cxx +1 END-IF GOTO P101
.
P102. DISPLAY" ******************** BEGIN TEST0528 ******************* DISPLAY" PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
NORMSQ NOT="02000" MOVE0TO flag END-IF if (NORMSQ = "02000"AND NORMSQ NOT = DISPLAY " 4.9 PP.1 -- A table is a multiset of rows then DISPLAY" xxxxx" SQLSTATE "ELETE FROM TEMP_S;"
java.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67 "Countof 12sshould be 4 value is ,c12 DISPLAY"Count of 13s should be 2;java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"Count of others " ,,CITYFROM ;java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 if (c10 ,, STAFFEND-EXEC MOVE0TO flag END-IF if (java.lang.StringIndexOutOfBoundsException: Range [40, 21) out of bounds for length 40 MOVE flag END-IF
" C14221;java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 EXECSQLCLOSE C14221 END-EXEC MOVESQLCODETO SQL-COD PERFORMCHCKOK DISPLAY" DISPLAY "FROMTEMP_Sjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
"C14222CURSORFOR" DISPLAY" SELECT GRADE FROM TEMP_S ORDER BY GRADE;" EXEC AY OPENC14221" SELECT GRADE SQL C14221
int1 - DISPLAY"FETCH java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 EXECSQL FETCH DISPLAY "FETCH C14221:" MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should SQLCODE SQL-COD if( = 10)then MOVE0TO flag END-IF
COMPUTE int1 - DISPLAYif(nt1 = 10) then EXECSQL FETCH C14222 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 12; its value is " fint1= )then if (int1 NOT = 12) then MOVE0TO flag END-IF
MPUTEint1=-java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 DISPLAY"FETCH C14222 INTO :int1;" EXEC java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 0 MOVE DISPLAY "SQL be100its valueis" PERFORM CHCKOK " ; " if (int1 NOTif( =100NOT02000) MOVE0TO flag
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 30 DISPLAY"FETCH C14222 INTO :int1;"
FETCH C14222 INTO :nt1END-EXEC MOVESQLCODETO SQL-COD DISPLAYCountof should 4;itsvalue" c12 DISPLAY"Count of should 0; is" "nt1 12 ,int1 if (int1 NOT = 12) then MOVE0TO flag END-IF
int1 - DISPLAY"FETCH C14222 INTO :int1;" EXECMOVE0 MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 12; its value is ", int1 NOT=12) MOVE0TO flag END-IF
=1 DISPLAY"ETCH int1;java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 13; its value is "SQL
0 flag
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
-1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222PERFORM TO PERFORM CHCKOK DISPLAY"int1 should be 13; its value is ", int1 if (int1 NOT = 13) then MOVE0TO END-IF
MOVE4TO cxx
.
P103. COMPUTE int1 = (=12 java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38 DISPLAY"FETCH C14221 INTO :int1;" EXECSQLFETCH C14221 INTO :nt1END-EXEC MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) then PERFORM CHCKOK "Skipping remainder of subtest." GO END-IF DISPLAY"int1 is ", int1 if (int1 = 12) then GOTO P105
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 COMPUTE cxx = cxx java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 47 if (cxx > 0) then GOTO P103
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 DISPLAY"Error -- should have run into a grade DISPLAYEND-IF GOTO P104
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
P105. DISPLAY"DELETE FROM TEMP_S DISPLAY "int1 should be 13; its value EXECSQLDELETEFROM TEMP_S WHERE CURRENT flag END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"OPEN C14221;" EXECSQLOPEN C14221 java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 25 MOVESQLCODETO DISPLAY "OPEN C14221OPEN" PERFORM CHCKOK DISPLAY" "
MOVE0TO MOVE0TO c12 0TO c13 MOVE0TO cxx
.
P106. COMPUTEint1=-java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 DISPLAY FETCH INTO:; EXECSQL FETCH C14221 INTO :int1 java.lang.StringIndexOutOfBoundsException: Range [0, 54) out of bounds for length 36 MOVESQLCODETO SQL-COD if(QLCODENOT = 0)then GOTO Skippingremaindersubtest. END-IF
DISPLAYint1is, if (int1 = 10) then COMPUTE c10 = END-IF if (int1 = 12) then COMPUTE c12 = c12 + 1 END-IF if (int1 = 13) then COMPUTE c13 = c13 + 1 END-IF if (int1 NOT = 10AND 13) then COMPUTE cxx = cxx + 1 END-IF GOTO P106
.
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 DISPLAY"QLCODEshouldbe 100;its is ",SQL-COD DISPLAY"SQLSTATE should be 02000; its value is ", SQLSTATE
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0 if (SQLCODENOT = 100OR"java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 36 MOVE0TO flag END-IF if (NORMSQ " java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0 DISPLAY"Count of 13s should be 2; its value is ", c13 MOVE0TOc12 DISPLAY"Count of java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 MOVE0TO flag END-IF if ( =2cxxNOT MOVE0TO flag END-IF
DISPLAY"CLOSE C14221;"
SQL C14221 MOVESQLCODETO SQL-COD
RFORM
if int1 )
DISPLAY"OPEN C14222;"
CSQLOPEN C14222END-EXEC
PERFORM CHCKOK DISPLAY" "
COMPUTE=- DISPLAY"FETCH C14222 INTO :int1 EXECSQL FETCH C14222 i = MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 10; its value cxx = +1 if (int1 NOT = GOTO MOVE0TO END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1 S =100 java.lang.StringIndexOutOfBoundsException: Range [50, 48) out of bounds for length 72 EXECSQL FETCH C14222 TO PERFORM CHCKOK DISPLAY"int1java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 if MOVE0 END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODE MOVE 0 TO fla PERFORM CHCKOK DISPLAY"int1 should be 12; its value is ", int1 if (int1 NOT = 12) then MOVE0TO flag END-IF
EXEC
int1 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 :java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 0 EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD
CHCKOK DISPLAY"int1 should be 13; its value is ", int1 if (int1 NOT = 13) then MOVE0TO flag END-IF
COMPUTE DISPLAY "int1 10 its is" int1 DISPLAYFETCH C14222 INTO int1" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 13; java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 30 if (int1 NOT = 13) then MOVE0TO flag END-IF
MOVE4TO cxx
.
P108. INTO:java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 47 COMPUTE int1 = -1 DISPLAY"FETCH C14221 INTO :int1;" EXECSQL FETCH C14221 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD if (SQLCODENOT = 0) then PERFORM CHCKOK DISPLAY"Skipping remainder of java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0 GO END-IF DISPLAY"int1 is ", int1 if (int1 = 12) then GOTO P110 END-IF COMPUTE -java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 if (cxx > 0) then GOTO P108 END-IF DISPLAY"Error -- should have run into a grade java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 54 DISPLAY"Skipping java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 25 GOTO P109
.
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 13 DISPLAY"UPDATE TEMP_S SET GRADE =
- " C14221;" EXECSQL UPDATE TEMP_S SET GRADE = 13WHERE
C14221 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
.
P109. DISPLAY"CLOSE C14221;" EXECSQLCLOSE C14221 END-EXEC MOVE java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30 PERFORM CHCKOK
EXEC :
(NOT= 0) EXECSQLOPEN C14221 END-EXEC MOVESQLCODETO java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 25 PERFORM CHCKOK DISPLAY" "
MOVE0TO c10 MOVE0TO c12 MOVE0TO c13
c >0)
.
P111. COMPUTE int1 = -1 DISPLAY"FETCH C14221 INTO :int1;" EXECSQL FETCH C14221 INTO TOjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 MOVESQLCODETO SQL-COD if(SQLCODE0)then GOTO P112 END-IF DISPLAY"int1 is ", int1 if (int1 = 10) then COMPUTE c10 = c10 + 1 END-IF if (int1 = 12) then COMPUTE c12 = c12 + 1 END-IF if (int1 = 13) COMPUTE c13 END-IF EXECCLOSEEND-EXEC 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 ", java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 25 PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS
(SQLCODE =100NOT= "2000)then MOVE0TO flag END-IF if ( cxx then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY"Count of 10s should be 1; SQLCODE = 0 then DISPLAY"Count of 12s should be 2; its value DISPLAY"Count of 13s should be 3; its value is ", c13 DISPLAY"Count of others should be 0; its value is ", java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 36 if (if (int112 java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 MOVE0TO flag END-IF
(=3ORcxxNOT=0 MOVE0TO END-IF
DISPLAY"OPEN C14222;" EXECSQLOPEN C14222 END-EXEC MOVESQLCODE"10 should ; its is"
CHCKOK DISPLAY" "
COMPUTE int1 = -1 DISPLAY" C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY"int1 should be 10; its value is ", java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19 if (int1 flag 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" DISPLAY " ;"
int1 NOT= 12)then MOVE0 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
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
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 MOVE0 java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 19 END-IF
COMPUTE int1 DISPLAY" C14222 INTO :int1" DISPLAY"FETCH C14222 INTO :int1;" EXECSQL FETCH C14222 INTO :int1 END-EXEC
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36 PERFORM CHCKOK DISPLAYMOVE flag if (int1 NOT = 13) then MOVE java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 END-IF
COMPUTE int1 = -1 DISPLAY"FETCH C14222 INTO :java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 36 EXECSQL FETCH C14222 INTO :int1 END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" be ; value is ,int1 if (int1 NOT = 13) then MOVE0TO flag END-IF
DISPLAY"java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 37 EXECSQLROLLBACK WORK END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK 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. DISPLAY0 is DISPLAY"SQLSTATE should be 00000; its value is ", SQLSTATE PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 0OR NORMSQ NOT = " MOVE0TO flag END-IF if (NORMSQ = "00000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 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 java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
MOVE3TO norm1 *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING norm2 FROM14 java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 if (NORMSQX( *subclasses with 000. This replacement equates valid 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(ORMSQ = SQLSTATE)then GOTO EXIT-NOSUBCLASS END-IF
MOVE4TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 FROM1BY1UNTIL norm2 > 36 if (NORMSQX MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
MOVE5TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROM1BY1UNTIL norm2 END-IF if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) END-IF
*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 MOVE"0"TO NORMSQX(2) END-IF
.
. EXITjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
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.