IDENTIFICATION. PROGRAM-IDDIVISION ENVIRONMENTjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 CONFIGURATIONSECTION. * SOURCE-COMPUTER. xyz. OBJECT-COMPUTER. xyz. DATADIVISION. WORKING-STORAGESECTION.
* EMBEDDED COBOL (file "DML062.PCO")
**************************************************************** * * 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. * * DML062.PCO * WRITTEN BY: SUN DAJUN * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * THIS ROUTINE TESTS COMMIT AND VIEW * * REFERENCES * AMERICAN NATIONAL STANDARD database language - SQL * X3.135-1989 * * EMBEDDED COBOL (file "DML062.PCO") * SECTION 6.9 <view definition> * ****************************************************************
EXEC0 PIC(9 SIGN.
0 PIC(9)DISPLAYLEADING
01 HOURS1 PIC* NIST SQL VALIDATION TEST SUITE V6.0 PIC S9 SIGNSEPARATE
0 SECND2* This program was written by employees of NIST to test SQL
01 count4 01 PNUM1 P X(3)
01 count5 (9) DISPLAYSIGNSEPARATE* this program.
01 count1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE.0EMPN2()
01 SECND1 PIC X(1).
01 SECND2 PIC* WRITTEN BY: SUN DAJUN
01 PNUM1 PIC X(3).
01 EMPN1 PIC X(3).
01 EMPN2 PIC* THIS ROUTINE TESTS COMMIT AND VIEW
01 uid PIC X(18).
01 uidx PIC X(18). EXECSQLEND DECLARE SECTIONEND-EXEC PIC(COMP
01 errcnt PIC1test10 PICX(8)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
01 i PIC S9(9) DISPLAYSIGNcount3 S9 SIGN.
01 flag PIC S9(9) DISPLAYSIGNLEADINGSEPARATE 01 SQLCODEPIC(9) COMP.
MOVE 1SQLCODE().
AUTHIDUSING MOVE1java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
USER:uidx HU.ECCO ifDIVISION. DISPLAY": P0. DISPLAYUser " connected." DISPLAYCALL"AUTHID"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
S java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 END-IF
TO DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, dml062.pco" DISPLAY" " DISPLAY
5-byte"
Ed#java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 " * date_time print *
java.lang.StringIndexOutOfBoundsException: Range [17, 11) out of bounds for length 34 ACCEPT THE-TIME FROMTIMEEND-IF DISPLAY"Date run YYMMDD " TO-DAY
******************** BEGIN TEST0274 ******************* *COMMIT AND ROLLBACK across schemas
DISPLAY" COMMIT & ROLLBACK "SQLSuite,Embedded." DISPLAY" X3.15-1989 sectionsection .2 General Rules"" DISPLAY" ------------------------------------------ " DISPLAY" TEST0274 DISPLAY DISPLAY" Reference Reference 8.2 General Rules )" DISPLAY" - - - - - - - - - - - DISPLAY "TEd #" DISPLAY" " DISPLAYFROMjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 DISPLAYDISPLAY"TEd #" DISPLAY" SULLIVAN1.java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
ISPLAY VALUES(0,A';java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 ACCEPT TO-DAYFROMDATE DISPLAY"INSERT INTO SULLIVAN1.AUTH_TABLE" DISPLAY" (0DISPLAYrun DISPLAY" "DISPLAY .-8 DISPLAY" DELETE FROM AA;" DISPLAY" COMMIT & ROLLBACKacrossschemas" DISPLAY" DISPLAY" VALUES ('In God we trust');" "--- - --- ----" DISPLAY" " DISPLAY" DISPLAY" DELETE FROM SULLIVAN1.AUTH_TABLE;" DISPLAY" " DISPLAY" DELETE FROM AA;" "ROLLBACK ; DISPLAY" " DISPLAY" -- - --- - -- - - -
-.;" DISPLAY" " COMPUTE count1 = -1 EXECSQLFROMSULLIVAN1 ;java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 MOVE ""
VALUES (10,'A MOVEDISPLAY"VALUES 0,A'" EXECSQLINSERTDISPLAY" INTO SULLIVAN1.AUTH_TABLE"
VALUES DISPLAY"VALUES (0,B')" MOVE"java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 EXECDELETEFROMEND-EXEC
SQLCODE QL-COD EXECSQLINSERTINTO AA
(' count1 =-
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 23 EXEC
SQLCODE SQL-COD EXECSQLFROMEXECINSERTSULLIVAN1 MOVE DISPLAY"" MOVE SQLCODE TO SQL-COD
L ROLLBACK END-EXEC SQLCODE java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 MOVE SQLCODE TO SQL-COD
() : java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
SULLIVAN1 - SULLIVAN1
SQLCODE TOSQL-COD MOVE"NV"TO test1 SQLCHARTESTFROMEND-EXEC MOVETO SQL-COD
XEC DELETEFROM AA MOVETOjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 FROMAUTH_TABLE MOVE SQLCODE TO SQL-COD DISPLAYSQL WORK (00,B)END-EXEC DISPLAY" count1 MOVE SQLCODE TOSQL-COD DISPLAYEXECSQLFROMSULLIVAN1AUTH_TABLE DISPLAY" Your answer is :" DISPLAYMOVETO DISPLAY" test1 ="- ('In God we trust') END-EXEC
if ( = 2 AND ="In we trust")then SQLCOUNT) SQLINTOjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
VALUES('02 MOVE"" TO MOVESQLCODETOQL-COD MOVETO else
SQLCODE EXECSQLEXEC ROLLBACKSQLCODESQL-COD
******************** END TEST0274 *******************
******************** BEGIN TEST0275 ******************* *COMMIT and ROLLBACK of multiple cursors
DISPLAY" COMMIT & ROLLBACK of multiple cursors " DISPLAYEXECSQLFROM SULLIVAN1.AUTH_TABLEEND-EXEC DISPLAY" ------------------- VALUES(024''','') END-EXEC DISPLAYTEST0275 DISPLAYMOVESQLCODE SQL-COD DISPLAYDISPLAY" Your answeris :java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 "" DISPLAY DECLAREEMPNUM
- 1TO DISPLAY" if count1 END-IF " DISPLAY
-" WORKS1" "WHERE EMPNUM= E3;java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 " java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" DECLARE DISPLAY " dml062fail
- " PROJ1" DISPLAY
VAL('027',fail
D " UPDATE STAFF1java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
Y SET= 'E9'java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 OF CHICHI END-IF DISPLAY UPDATE DISPLAYSET"Reference8 Rules )" EXECSQL""
" DISPLAY" UPDATE PROJ1" DISPLAY" SET PNUM = 'P9'" DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DISPLAY DISPLAY" ******************** BEGIN TEST0275 ******************* DISPLAY COMMIT ofmultiple DISPLAY"" "STAFF1EMPNUM=WORKS1. AND" " PROJ1.PNUM =WORKS1.;" EXECSQLDELETEFROM STAFF1 END-EXEC MOVE SQL-COD DISPLAY""
OMPUTE 1 EXECSQL" DISPLAY"SET = 'E9'" DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 EXECSQLINSERTINTO WORKS1 SELECTFROMEND-EXEC TO
XEC INSERTINTO"SETPNUM= '" SELECTWHERE ; MOVE SQLCODE TO SQL-COD SQLCHICHI FOR STAFF1
DISPLAY " *FOR UPDATE OF EMPNUM; EXECSQL DECLARE MAC " "
WHEREEjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 *FOR UPDATE OF EMPNUM, PNUM; EXECSQL DECLARE "DECLAREKINGCURSORFOR SELECT PNUMjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
WHERE END-EXEC *FOR UPDATE OF PNUM; EXECOPEN CHICHIEND-EXEC MOVETO SQL-COD EXECSQLOPEN MAC END-EXEC MOVESQLCODE SQLCODE SQL-COD EXECSQLOPEN KING END-EXEC MOVE SQLCODE TODISPLAY" EXEC" SET EMPNUM =' SELECT* END-EXEC MOVETO EXECSQL FETCH INTO MOVE SQLCODESELECT WORKS EXEC" UPDATEPROJ1java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 " WHERE OF KING;" EXECSQLMOVETO SET =''
WHERE OFEND-EXEC MOVE SQLCODE TO SQL-COD EXECSQL UPDATE WORKS1
ET='', PNUM'
WHEREDISPLAY" FOR UPDATE OF EMPNUM, PNUM; MOVESQLCODE EXECSQLKING CURSORSELECT PROJ1 EXEC MAC""
WHERE KING MOVETO SQL-COD EXEC COMMIT END-EXEC MOVE SQLCODE TOSQL CHICHI: END-EXEC EXECSQLCOUNT* :ount1
STAFF1,WORKS1 EXECINSERTSQLMACEMPN2
WHERE STAFF1 MOVESQLCODE SQL-COD
.EMPNUM WORKS1AND
PROJ1 SELECTFROMEND-EXEC MOVE = ''
WHERECHICHI
SQLCODE SQL-COD EXECSQL HERE = 'E3'END-EXEC MOVE = '', PNUM MAC java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 SQLFROM*FOR UPDATE OF EMPNUM, PNUM; CODETO SQL-CODMOVE SQL-COD
PNUM=''END-EXEC DISPLAY" count1 EXEC SQL OPENCHICHI END-EXEC is : DISPLAY" count1 = ", count1EXECSQLOPENMAC SQL-COD
SQLCODE SQL-COD DISPLAY" * MOVESQLCODETO java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 SQL
VALUES('0275','pass','PCO') END-EXEC
SQLCODE TO SQL-COD SQL FETCH INTO EMPN2
.pcofail EXECEXEC FETCH INTO PNUM1 ') END-EXEC ADD 1 TO errcnt EXEC STAFF1 MOVE SQLCODE TO SQL-COD END-IF
====================="
EXECSQL COMMIT WORK END-EXEC MOVETOSQL-COD
******************** END TEST0275 *******************
******************** BEGIN TEST0276 ******************* *View across schemas
DISPLAY" EXEC SQL UPDATE PROJ1 DISPLAY"Reference X3.15-189section .java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" -----------DISPLAY * pass * " DISPLAY" TEST0276 " " Reference 6.9General Rules )java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 DISPLAY"- - - -- ---- --- - - --- java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 " " DISPLAY" DELETE FROM SULLIVAN1.AUTH_TABLE;" DISPLAY" " " INSERT INTO SULLIVAN1.AUTH_TABLE" DISPLAY" VALUES 1,A)" DISPLAY" " DISPLAYVALUES. = 'E9'java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 DISPLAY" OVESQLCODETO SQL-COD
- " SULLIVAN1.MUL_SCH" DISPLAYORDER" DISPLAY" " EXECEXEC COMMIT END-EXEC MOVE SQLCODE TO SQL-COD EXECSQL
VALUESA)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 SQLDELETEFROMEND-EXEC EXECSQL DECLARE PIGGY
EMPNUMFROM.MUL_SCH ORDER EMPNUM EXECOPEN MOVE SQLCODE "--------------------java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 EXECDISPLAYDISPLAY"Reference . Rules)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 MOVE SQLCODE EXEC PIGGY SECND2 MOVE SQLCODEDISPLAY ." EXECCLOSEEND-EXEC MOVE SQLCODE TO SQL-COD SQLEND-EXEC
SQLCODE SQLCODESQL-COD DISPLAY" The correct answer is :" DISPLAY"DISPLAY""
DISPLAY"SECND1=A" " EMPN2 =E4" DISPLAY" = A" ADD1TO
EMPN1 " EMPN1 DISPLAY" SECND1 = ", SECND1 DISPLAY" END-IF DISPLAY" SECND2 = ", SECND2 MOVE 0 TO flag SQLEND-EXEC COMPUTE flagSQLINTOSULLIVAN1 END-IF if (EMPN2 NOT = "E4") then COMPUTE flag END-IF
******************** END TEST0276 *******************
******************** BEGIN TEST0279 ******************* *IN is a 3-valued predicate, EXISTS is 2-valued
DISPLAY"INis a3- predicate, EXISTS is 2- flag =lag+java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
1General SQL FETCH INTO :EMPN2,:SECND2 DISPLAY" .17GeneralRules" DISPLAY"------------------------------" DISPLAY" " Reference5.1 5.7 General Rules )" DISPLAY - -------------MOVE DISPLAY" " DISPLAY" UPDATE WORKS" DISPLAY" SET HOURS = NULL" DISPLAY" WHERE PNUM = 'P5' OR EMPNUM DISPLAY " = E4" DISPLAY" " DISPLAY" SELECT COUNT(*) INTO : FROM STAFF;" " java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAY" SELECT COUNT() INTO :ount2 FROM " DISPLAY" WHERE 4 IN SELECT HOURSFROM WORKS" DISPLAY" WHERE STAFF.EMPNUM =
- " java.lang.StringIndexOutOfBoundsException: Range [18, 15) out of bounds for length 40 DISPLAY" " DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"WHERE 40 NOT IN(SELECT HOURS FROM WORKS" DISPLAY" WHERE STAFF.EMPNUM =
- DISPLAY" " DISPLAY" SELECT COUNT(*) END-IF DISPLAY" WHERE EXISTS (SELECT * FROM WORKS" DISPLAY" WHERE HOURS 40 AND STAFF.EMPNUM =
- " WORKS DISPLAY" " DISPLAY" SELECT COUNT(*) INTO :count5 FROM STAFFjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 DISPLAY"WHEREDISPLAY".7 Rules DISPLAY" WHERE HOURS = 40 AND ISPLAY -----------------------java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-" .EMPNUM);" DISPLAY" " COMPUTE =-1 COMPUTE count2 = -1
OMPUTE1 COMPUTEcount4 -1 COMPUTE count5 = -1 SQL WORKS SET HOURSNULL
WHERE PNUMDISPLAYSETHOURS NULL MOVETO SQL-COD EXEC"I INTOTESTREPORT
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 EXECSQLSELECTMOVE SQLCODE SQL-COD
WHERE INSELECTFROMjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
WHERE.EMPNUM DISPLAY" 0 (SELECT HOURSFROM ORKSjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 MOVE SQLCODE TO SQL-COD EXECSQLSELECTCOUNT( DISPLAY" COUNT(java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 36
WHERE 40 NOTIN (SELECT HOURS====="
WHERE STAFF.EMPNUM EXECSQLCOMMIT END-EXEC MOVE" " COUNT)INTO STAFF
WHERE EXISTS (SELECTMOVESQLCODE SQL-COD
WHERE ******************** END TEST0276 ******************* MOVEDISPLAY"
- .EMPNUM
WHERE " "
WHERE HOURS = 40 AND STAFF java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVESQLCODE SQL-COD*IN is a 3-valued predicate, EXISTS is 2-valued EXEC"WHEREHOURS= 4 AND STAFFEMPNUM MOVE SQLCODE TO SQL-COD DISPLAY" The correct answer is :" DISPLAY" count1 = 5" DISPLAY" count2 = 2java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 DISPLAY" count3 = 2" DISPLAY" count4 = 2" DISPLAY" count5 = 3" DISPLAY Yourjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 38 DISPLAY" count1 =" java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 " count2="count2 DISPLAY" count3 = ", count3 DISPLAY ----- --- -- - -------- " DISPLAY" count5 = ", count5
0 TO if ( SET="
2 java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
1TO END-IF
count42OR = 3 then MOVETO flag END-IF if (flag = 0) then DISPLAY" *** pass *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0279','pass','PCO') END-EXEC MOVE SQLCODE TO SQL-COD else DISPLAY dml062*fail EXECSQLINSERTSQLCOUNT(*) :count4STAFF
VALUES('0279','fail','PCO') EXISTS SELECTFROM
1 TO HOURS= 40AND.EMPNUM= EMPNUMEND-EXEC MOVE SQLCODE TO SQL-CODDISPLAY"java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 END-IF DISPLAY"============================java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
EXECSQL COMMIT WORK END-EXEC TO
******************** END TEST0279 *******************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
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.