**************************************************************** * * COMMENT SECTION * * DATE 1989/07/21 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. * * DML061.PCO * WRITTEN BY: SUN DAJUN * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * THIS ROUTINE TESTS BETWEEN, SET FUNCTIONS, AND INTEGRITY. * * REFERENCES * AMERICAN NATIONAL STANDARD database language - SQL * X3.135-1989 * * SECTION 5.12 <between predicate> * SECTION 5.8 <set specification> * SECTION 7.3 <procedure> GR 3b * ****************************************************************
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 CALL"AUTHID"USING uid MOVEnotlogged innotTOuidx EXECSQLSELECT
USER INTO :uidx FROM HU.ECCO END-EXEC if ( * date_time declaration * DISPLAY"ERROR: expected." DISPLAY"User " uidx " connected." DISPLAY" " STOPRUN END-IF
MOVE0TO P0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
"SQL Test Suite, V6 java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 44 DISPLAY" " DISPLAY "59-byte ID" DISPLAY" Version #java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 DISPLAY"" * date_time print * ACCEPTDISPLAY"" ACCEPT THE-TIME FROMTIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff DISPLAY
******************** BEGIN TEST0269 *******************
*BETWEEN value expressions in wrong order
DISPLAYDISPLAY" Version" DISPLAY"Reference X3.135-1989 DISPLAY" ------------------------------------------ " DISPLAY" TEST0269 " DISPLAY" Reference 5.12 General Rules )" DISPLAY" - - - java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" " DISPLAY" java.lang.StringIndexOutOfBoundsException: Range [0, 38) out of bounds for length 0 DISPLAY" FROM WORKS" DISPLAY"WHERE BETWEEN 80 AND 40;" DISPLAY" INSERT INTO WORKS" DISPLAY" VALUES('E6','P6',-60);" DISPLAY" " DISPLAY" SELECT COUNT(*) INTO :count2" DISPLAY" WORKS" DISPLAY" WHERE HOURSDISPLAY "Reference5. Rules" DISPLAY" " DISPLAY" SELECT COUNT(*) INTO :count3" DISPLAY" WORKS" DISPLAY" WHERE HOURS BETWEEN :min1 AND :max1;" DISPLAY" " MOVETOcount1 MOVE -1TO count2 MOVE -1TO count3 EXECSQLSELECTCOUNT(*) INTO :count1 FROM WORKS WHERE HOURS BETWEEN 80AND40END-EXEC MOVESQLCODETODISPLAYFROM WORKSjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 EXECSQLINSERTINTO WORKS
VALUES('E6','P6',-60) END-EXEC MOVESQLCODETO" HOURS min1 :;java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 MOVE40TOmax1 MOVE -80TO min1 EXECSQLSELECTCOUNT(*) INTOMOVE1TO FROM WORKS WHERE HOURS java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 MOVESQL-COD EXECSQLSELECTCOUNT(*) INTO :count3 FROM WORKS WHEREBETWEEN:in1 :ax1 MOVESQLCODETO SQL-COD EXECSQLROLLBACK WORK END-EXEC MOVESQLCODETO SQL-COD DISPLAY"MOVE TO SQL-COD DISPLAY" count1 = 0" DISPLAY"count2 = 0" DISPLAY" count3 = 1" "Youranswer is " DISPLAY" count1 = ", count1 DISPLAY" MOVE SQLCODE TO SQL-COD DISPLAY" = " count3
if" count2 =0java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 DISPLAY" *** pass *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0269','pass','PCO') END-EXEC MOVESQLCODETO SQL-COD else
pco**java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 53
VALUES('0269','fail','PCO') END-EXEC 1TO errcnt MOVESQLCODETOSQL-COD END-IF DISPLAY"================================java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO SQL-COD
******************** END TEST0269 *******************
******************** BEGIN TEST0270 ******************* *BETWEEN approximate and exact numeric values
DISPLAY"BETWEEN value with comparable data types " "ReferenceX3135-989 section 5.12SR1" DISPLAY" ------------------------------------------ " DISPLAY" TEST0270 "
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0 DISPLAY" - - - - - - - - - - - - - - - - - DISPLAY" " DISPLAY" SELECT COUNT()INTO count1" DISPLAY" FROM WORKS" DISPLAY"WHEREHOURSBETWEEN ff1AND:
- " " DISPLAY" HOURS BETWEEN 19.999 AND 2.001E1;" "" MOVE -1TO count1 MOVE11TO ff1 MOVE12TO HOURS1 EXECSELECTCOUNT()INTO count1 DISPLAY" BETWEEN 19.999 AND 2.01E1;" WHERE HOURS BETWEEN :ff1
HOURS BETWEEN 19.999AND2.001E1 END-EXEC MOVESQLCODE SQL-COD DISPLAY"The ::" DISPLAY" count1 = 6" DISPLAY" Your answer is :" DISPLAY" =" count1
******************** END TEST0270 *******************
******************** BEGIN TEST0271 ******************* *COUNT(*) with Cartesian product subset
DISPLAY"COUNT (*) with Cartesian java.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 34 DISPLAY DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" section 5.20 GR 2b" DISPLAY" section 5.21 1,2"
java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 57 DISPLAY" TEST0271 " DISPLAY" Reference 5.8 General Rules )" DISPLAY" -java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 "" DISPLAY" SELECT COUNT(*) INTO :count1" DISPLAY" FROM WORKS,STAFF" WHERE. ='';"
EXECSQLSELECTCOUNT*)INTO:count1 FROM WORKS,STAFF WHERE WORKS.EMPNUM ' END-EXEC MOVESQLCODETO SQL-COD
DISPLAY" The correct answer is :"
EXEC SQ SELECTCOUNT*) INTO :ount1 DISPLAY" Your answer is :" DISPLAY" count1 = ", count1
if (count1 = 30) then DISPLAY" *** pass *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0271','pass','PCO') END-EXEC MOVESQLCODETO SQL-COD else DISPLAY" dml061.pco *** java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 0 EXECDISPLAY" **pass ** "
VALUES('0271','fail','PCO') END-EXEC ADD1TO errcnt MOVESQLCODETO SQL-COD END-IF DISPLAY ==========================="
EXECSQLCOMMIT WORK END-EXEC MOVE java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 28
******************** END TEST0271 *******************
******************** BEGIN TEST0272 ******************* *Statement rollback for integrity violation.
DISPLAY" Statement rollback for integrity
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" TEST0272 "
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
- - --- " DISPLAY" " DISPLAY" UPDATE WORKS" DISPLAY" EMPNUM ''" DISPLAY" WHERE EMPNUM = DISPLAY"----------------------- " DISPLAY" " " INSERT WORKS java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 DISPLAYSELECTjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 DISPLAY" " DISPLAY" UPDATE V_WORKS1" DISPLAY" SET HOURS = HOURS - 9;" DISPLAY" " DISPLAYSELECTCOUNT(* INTO: FROMWORKS" DISPLAY" WHERE EMPNUM = DISPLAY INSERTINTO WORKS "
- " 17;"
ISPLAY"" MOVE0TO count1 TO MOVE0TO count3 MOVE -1TO count4 EXECSQL UPDATE WORKS SET EMPNUM = 'E7' WHERE EMPNUM = 'E1'OR EMPNUM = 'E4'END-EXEC MOVESQLCODETO SQL-COD MOVESQLCODETO count1 EXECSQLINSERTINTO WORKS SELECT'E3', 0TO java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27 MOVESQLCODETO SQL-COD MOVESQLCODETO count2 EXECSQL UPDATE V_WORKS1 SET HOURS=HOURS-9END-EXEC MOVESQLCODETO SQL-COD MOVESQLCODETO count3 EXECSQLSELECTCOUNT(*) INTO :count4 FROM WORKS WHERE EMPNUM ='E7 OR 31 HOURS=17END-EXEC
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 34 EXECSQLROLLBACK
E DISPLAY" DISPLAY" count1 < 0" DISPLAY" count2 < 0" DISPLAY" count3 < 0" DISPLAY" count4 = 0" MOVETOSQL-COD DISPLAY"count1= " count1 DISPLAY" count2 = ", count2 DISPLAY" count3 DISPLAY " correctanswer : DISPLAY" count4 = ", count4
if (count1 < 0AND count2 < 0AND count3 < 0AND
count4 = 0)then DISPLAY" *** pass *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0272','pass','PCO') END-EXEC MOVE <0AND < 0 java.lang.StringIndexOutOfBoundsException: Range [67, 59) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15 DISPLAY" dml061.pco *** fail *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0272','fail','PCO') END-EXEC 1TOerrcnt MOVESQLCODETOEXECINSERTINTO TESTREPORT END-IF DISPLAY"==========================================
SQLCOMMITEND-EXEC MOVESQLCODETO SQL-COD
******************** END TEST0272 *******************
******************** BEGIN TEST0273 ******************* *SUM, MAX, MIN = NULL for empty arguments
DISPLAY" ******************** BEGIN TEST0273 ******************* DISPLAY N = NULLfor empty arguments DISPLAY DISPLAY" Reference 5.8 General Rules )" DISPLAY" - - - - - - - - - - - - - - - - - - - - - ----------------- java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 DISPLAY" " - ------ ---------" DISPLAY" UPDATE WORKS" DISPLAY" SET HOURS = NULL;" DISPLAY" " DISPLAY" SELECT SUM(HOURS)MAXHOURS,MIN(HOURS" DISPLAY" INTO
:um1:ndic1m:indic2:min1indic3java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
WORKS;" DISPLAY" " MOVE0TO indic1 MOVE0TO indic2 MOVE0TO indic3 EXECSQL UPDATE WORKS SET HOURS = NULLEND-EXEC
DISP "" EXECSQLSUM(OURSMAXHOURS)() INTO :sum1:indic1,:max1:indic2,:min1:indic3 FROM WORKS END-EXEC MOVESQLCODETO SQL-COD MOVE indic1 TO DISP1 MOVE indic2 TO DISP2 MOVE indic3 TO DISP3
SQLROLLBACK WORKEND-EXEC MOVESQLCODE DISPLAY" The correct answer is :" DISPLAY" indic1 < 0" DISPLAY" DISPLAY" indic3 < 0" DISPLAY" Your answer is :" DISPLAY" indic1 = ", DISP1 DISPLAY" indic2DISPLAY <0" DISPLAY" indic3 = ", DISP3
EXECSQLCOMMIT WORKDISPLAY"=====================java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 MOVESQLCODETO SQL-COD
******************** END TEST0273 *******************
******************** BEGIN TEST0277 ******************* *Computation with NULL value specification
DISPLAY Computation NULLvaluespec java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 DISPLAY"Reference X3.135-1989 section 5.6 GR " DISPLAY" ------------------------------------------ " DISPLAY" TEST0277 " DISPLAY" Reference 5.6 General Rules )" DISPLAY" - - - - - - - - - - - - - - - - - - - - - " "" DISPLAY" UPDATE WORKS" "SET NULL WHERE java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 60 DISPLAY" " DISPLAY" UPDATE WORKS" DISPLAY" SET HOURS = :count1:indic1 - " DISPLAY" (:count2:indic2 + :count3:indic3)" "EMPNUM ='2" DISPLAY" " DISPLAY" UPDATE WORKS" DISPLAY" SET HOURS = :count2:indic2 / :count3:indic3 * " DISPLAY" :count1:indic1" DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAY"" DISPLAY" UPDATE WORKS" DISPLAY" SET HOURS = HOURS + 5;" DISPLAY"" DISPLAY" SELECT COUNT DISPLAY"" DISPLAY DISPLAY" WHERE HOURS IS NULL; " DISPLAY" " MOVE -1TO indic1 MOVE0TO indic2 MOVE0TO indic3 MOVE11TO count1 MOVE3TO count2 MOVE -17TO count3 MOVE -1TO count4 EXECSQL UPDATE WORKS SET HOURS = NULLWHERE EMPNUM = 'E1'END-EXEC MOVESQLCODETO SQL-COD SQLUPDATE SETHOURS=:ount1:ndic1 ::java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 59
:count3:indic3) WHERE EMPNUM = 'E2'END-EXEC MOVESQLCODETO SQL-COD EXECSQL UPDATE WORKS SET HOURS = :count2:indic2 / E3
:count1:indic1
='3'END-EXEC TO
SET HOURS EXECSQLSELECT() MOVESQLCODE SQL-COD EXECSQLSELECTCOUNT(*) INTO :count4 FROM WORKS WHERE HOURS ISNULLEND-EXEC MOVESQLCODETO SQL-COD EXECSQLROLLBACK WORK END-EXEC SQLCODETO SQL-COD DISPLAY"The correct answer is :" DISPLAY" count4 = 9" DISPLAY" Your answer is : DISPLAY" count4 = ", count4
******************** END TEST0277 *******************
******************** BEGIN TEST0278 ******************* *IN value list with USER, literal, variable spec.
DISPLAY"IN value list with USER, literal, variable" DISPLAY"Reference X3.135-1989 section 5.6 GR " DISPLAY" ------------------------------------------ " DISPLAY" TEST0278 " DISPLAY" UPDATE " DISPLAY"--- -------- --- -- -- -" DISPLAY" " "" DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 23 DISPLAY" SET EMPNAME = 'HU'" DISPLAY" WHERE EMPNAME = 'Ed';" DISPLAY" " DISPLAY" SELECT COUNT(*) INTO : USER,EMPNA1:ndic1::ndic2:MPNA3) java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 DISPLAY" FROM STAFF" DISPLAY" WHERE EMPNAME IN " DISPLAY"
- " (USER,:EMPNA1:indic1,:EMPNA2:indic2,:EMPNA3); " DISPLAY" " MOVE1TOindic1 0 indic2 MOVE -1TO count1 MOVE"Alice"TO EMPNA1 MOVE"Betty"TO EMPNA2 MOVE"Carmen"TO EMPNA3 EXECSQL UPDATE STAFF SETEMPNAME='' WHERE EMPNAME = 'Ed'END-EXEC MOVESQLCODETO SQL-COD EXECSQLSELECTCOUNT(*) INTO USER,EMPNA1:,:MPNA2:,EMPNA3 java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 FROM STAFF WHERE EMPNAME IN
(USER,:EMPNA1:indic1,:EMPNA2:indic2,:EMPNA3) END-EXEC MOVESQLCODETO SQL-COD DISPLAY"SQLCODE = ", SQL-COD SQL WORK MOVESQLCODETO SQL-COD DISPLAY" The correct answer is :java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
count1 = " DISPLAY" Your answer is :" DISPLAY" count1 = ", count1
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.