**************************************************************** * * 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 * * SECTION 8.2 <commit statement> * SECTION 6.9 <view definition> * ****************************************************************
* date_time declaration *
01 TO-DAY 9(6).
01 THE-TIME PIC java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
PROCEDURE
P0 ERRORP0
" " uidx " MOVEnot ,notTO EXEC" RUN
errcntjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
( ""9byte DISPLAY Version " ""
ACCEPT TO-DAY FROMDATE
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
MOVE 0 TO errcnt ******************** BEGIN TEST0274 *******************
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 18 " Test , V6.0 COBOL, dml062pcojava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 DISPLAY3 8java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 "59-yte ID" DISPLAY Version DISPLAY" " * date_time print *
TO-DAY ACCEPT THE-TIME FROMTIME"59byte ID" DISPLAY"Date runYYMMDD:"TO-DAYathhmmssff"INSERTINTOAUTH_TABLEjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
******************** BEGIN TEST0274 ******************* *COMMIT AND ROLLBACK across schemas
" VALUES(0,'B " YYMMDD " "at hhmmssff THE-TIME "ReferenceX3.35-99 DISPLAY" ------------------------------------------ " DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0 DISPLAY"INSERTINTOAAjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 DISPLAY- --- --- --- - DISPLAY DISPLAYDELETE DISPLAYDISPLAY WORK DISPLAY" INSERT INTO SULLIVAN1.AUTH_TABLE"
DISPLAY SQLCODE() "java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAYVALUES0)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
SQLCODE " DISPLAY" " DISPLAY" SELECT COUNT(*) INTO :count1 FROM SQL AA DISPLAYMOVETOSjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 COMPUTE = EXECSQL MOVE SQLCODE TO MOVEMOVETO SQL .AUTH_TABLE
VALUES (10,'A') END-EXECDISPLAY" DELETEFROM SULLIVAN1.; SQLCODE TOSQL-COD
MOVE TO EXECSQLINSERTDISPLAY"ROLLBACKWORK"
VALUES0,B) NTINTOFROM MOVE .AUTH_TABLE".AUTH_TABLE;java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 EXECSQLDELETEFROM AA END-EXECEXECSELECTINTO AA MOVE SQLCODE TOEXEC SQLCODE SQL-COD EXECSQLINSERTINTO VALUES1'A') END-EXEC
VALUES'InGodwetrust') END-EXEC MOVEEXECSQLDELETE SULLIVAN1 END-EXEC EXEC COMMITVALUESB' java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 MOVE java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 DELETE. java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 MOVE SQL-COD EXECSQLSQLINSERT AA MOVE SQLCODE SQL-COD
MOVEEXECSQLCOMMIT ount1 test1God EXECSELECT(* INTO :count1java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
SULLIVAN1 END-EXEC MOVE SQLCODE TO SQL-COD
NV QL-COD EXECSELECT SQLCODE MOVE SQLCODE EXECMOVETO MOVETO EXECSQLDELETEFROM SULLIVAN1.AUTH_TABLE
SQLCODE SQL-COD DISPLAYTheis " java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 DISPLAY"EXECSELECTCHARTEST FROMAAEND-EXEC DISPLAYMOVETO
DISPLAY******************** END TEST0274 ******************* SQLCODE SQL-COD
if (ount1 test1"Injava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0 DISPLAY SQLCODE SQL-COD EXECINSERT TESTREPORT '7,pass',PCO " count1 java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 TO else DISPLAYDISPLAY"count1= , count1 EXECSQLINSERTINTO TESTREPORT
VALUESDISPLAY" CHICHI CURSOR FOR SELECT FROM ADD errcnt MOVE END-IF DISPLAY"DISPLAY""
EXECSQLCOMMIT END-EXEC DISPLAY''"
******************** END TEST0274 *******************
******************** BEGIN TEST0275 ******************* *COMMIT and ROLLBACK of multiple cursors
UES4','')END-EXEC DISPLAY ISPLAY" DISPLAY" ------- MOVE " CURRENT;" DISPLAY" WORKS1"
.Rules DISPLAY "" DISPLAY" DECLARE DISPLAY""
- " STAFF1" DISPLAY" WHERE EMPNUM = 'E3';" DISPLAY" " DISPLAYDjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
- " WORKS1" DISPLAY" WHERE EMPNUM = ' "* and ROLLBACK cursors
DISPLAY" DECLARE KING CURSOR FOR DISPLAY . =EMPNUMANDjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
- " PROJ1" TO DISPLAY java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 " UPDATESTAFF1java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 DISPLAY EMPNUM " WHERE CURRENT OF CHICHI;" " " DISPLAY" UPDATE WORKS1" DISPLAY" SET EMPNUM = 'E9', PNUM = 'java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 38 SELECT* WORKS
DISPLAY" UPDATE PROJ1" DISPLAYSETP9 DISPLAY java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 " DISPLAYOF
-WORKS1 DISPLAY" SELECT COUNT(*) INTO :count1 EMPNUM = 'E3' ND-EXEC " STAFF1WORKS1,PROJ1java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 DISPLAY KING FROM DISPLAY" STAFF1.EMPNUM = WORKS1.EMPNUM DISPLAY WHERE PNUM = 'P2' DISPLAY" PROJ1PNUM = WORKS1.PNUM;" EXECSQLDELETEFROM SQLCODE java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 MOVE DISPLAY" " 'java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
DISP " UPDATE WORKS1"
STAFF MOVESQLCODE SQLCODESQL-COD
WORKS1 DISPLAY" "
* FROMEND-EXEC DISPLAY
java.lang.StringIndexOutOfBoundsException: Range [31, 11) out of bounds for length 37 SELECT PROJ
SQLCODE SQL-COD SQL CHICHI EMPNUM
WHERE CURRENT CHICHI *FOR UPDATE OF EMPNUM; EXECSQL DECLAREDISPLAY""
WHERE = ' E9 ='P9 *FOR UPDATE OF EMPNUM, PNUM;
KINGFORPNUM
WHERE PNUM = 'P2'END-EXECDISPLAY"STAFF1.EMPNUM =WORKS1.EMPNUM AND" *FOR UPDATE OF PNUM; EXECSQLOPEN CHICHIEXECSQLFROM STAFF1 END-EXEC MOVE SQLCODE SQL-COD EXECSQLOPENDISPLAY" MOVE SQLCODE SQL-COD EXEC CURRENT OFEND-EXEC MOVE SQLCODESELECT*FROMEXECSQL WORK EXEC FETCH INTO :MPN1 MOVE SQLCODEMOVEEXECSQLCOUNT()INTOFROM EXEC FETCH :EMPN2 SELECTFROMWORKS EXEC EXEC SQL PROJ1=EMPNUM MOVETO SQL-COD SQL STAFF1 SETEMPNUME9
CURRENT END-EXEC MOVEMOVETOjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 EXECSQL UPDATE WORKS1 SETEMPNUME9 = 'P9EXECSQLDECLARE CURSOR FOR SELECTEMPNUMFROMWORKS1
WHERE CURRENT OFEXECDELETE
SQLCODE EXECSQL UPDATE PROJ1 SET PNUM *FOR UPDATE OF PNUM;
WHERE CURRENT MOVESQLCODE DISPLAY " Your answer MOVETO EXECSQL COMMIT MOVE SQLCODE SQL-COD MOVETO EXECSQLSELECTCOUNT( * SQL-COD
STAFF1,PROJ1
WHERE INSERTINTOTESTREPORT
SQLCODE java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
.PNUM WORKS1DISPLAYdml062****"
FETCH: END-EXEC EXECDELETEFROMCO MOVESQLCODEUPDATE EXECSQLFROMPROJ1 END-EXEC MOVE SQLCODE SQL-COD EXECSQL================java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 MOVE SQLCODE TOEXECSQL WORKS1 SQLCODE java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 DISPLAY" The correct DISPLAY =" DISPLAY" Your answer is :" DISPLAY" count1 = ", count1MOVESQLCODETOjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if (count1 = 1) then "*** java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 EXECSQLINSERTINTO TESTREPORT SQL WORK - --- - - MOVETO SQL-COD else DISPLAY" dml062.pco *** fail *** " EXECSQLINSERTINTO TESTREPORT "(2'';java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
WHEREEMPNUM' ADD 1 TO errcnt
SQL-COD END-IF DISPLAY"============ PROJ1PNUM = "BYEMPNUM
SQL WORK MOVESQLCODE SQL-COD
******************** END TEST0275 *******************
******************** BEGIN TEST0276 ******************* *View across schemas
DISPLAYMOVESELECT, SULLIVAN1 DISPLAY"Reference X3.135-1 SQL PIGGY END-EXEC DISPLAY ---------------------- " DISPLAY" TEST0276 "
6General DISPLAYDISPLAY" count1 " DISPLAY" if (count1 = 1EXEC SQLFETCH INTO :MPN2,: END-EXEC "DELETEFROMSULLIVAN1AUTH_TABLE;java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 "java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
LAY INSERTEXECROLLBACK DISPLAYMOVEMOVETOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 " SECND1 " DISPLAY" SELECT EMPNUM,SECOND2 FROM
- " SULLIVAN1.MUL_SCH" DISPLAY QLCODEjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 DISPLAY" " EXECDELETEFROMSULLIVAN1 END-EXEC MOVE SQLCODE TOEXEC COMMIT EXECSQLINTO SULLIVAN1
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 MOVE java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0 EXECSQL java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 SELECT EMPNUMif = A SECND2 = ORDERDISPLAY java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 EXECSQLEND-EXEC MOVE SQLCODE TO SQL-CODDISPLAY" --- VALUES('27'pass,PCO)END-EXEC EXECSQL.* *java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
(' DISPLAY " " SQLPIGGY EMPN2END-EXEC MOVE SQLCODE TO SQL-COD EXECDISPLAY" " MOVE SQLCODE TO SQL-COD EXECSQLEND-EXEC MOVE SQLCODE " VALUES (1,'A')" DISPLAY" The correct answer is :" DISPLAYDISPLAY SULLIVAN1
EXECSQLCOMMIT WORK END-EXEC DISPLAY"" "Your answer is :" DISPLAY SQLCODE SQL-COD
= ", SECND1 " EMPN2 = ",java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 DISPLAY SECND2, MOVE 0 TO if (EMPN1 COMPUTEflag END-IF ifEXECSQL PIGGYEND-EXEC COMPUTE = java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 END-IF
ifSECND1 A"AND SECND2="A" ANDflag =
0) then DISPLAY" *** DISPLAY " section 5.1 Rules " EXECSQL SQLCODE 5
VALUES('027 MOVE SQLCODETO DISPLAY "TEST0279java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 MOVE"-------- -- - SQLCODETO SQL-COD
DISPLAY" dml062.pco *** fail *** " EXECSQL DISPLAY" SECND1= " ADD 1 TO errcnt MOVE SQLCODE TODISPLAY" SECND2 = A" END-IF" DISPLAY"===== "*:STAFF "EMPN1=,java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
L COMMIT END-EXEC MOVETO
******************** END TEST0276 *******************
******************** BEGIN TEST0279 ******************* *IN is a 3-valued predicate, EXISTS is 2-valued
SELECT" COMPUTE flagflag
51 General"
D "---------------------java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"TEST0279" DISPLAY" count1 1 DISPLAY" - - - - - - - - - - - - - - - - - - C count3 = -java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 DISPLAY" "EXEC UPDATE DISPLAY"
" =" DISPLAY SQLCODE DISPLAY NSERT DISPLAY" SELECT COUNTMOVE SQLCODE TO SQL-COD DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAY" SELECT COUNT(*) DISPLAY " . ** failINHOURS
4IN W" DISPLAY" WHERE STAFF.EMPNUM = "WORKS.);" DISPLAY"" SELECTMOVESQLCODE SQL-COD DISPLAY 4 (FROM "================java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
- " WORKS.EMPNUM);" DISPLAY DISPLAY" SELECT COUNT(*EXECSQLSELECT (*) :count4FROM java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 DISPLAY" WHERE EXISTS (SELECT * FROMjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "WHERE
-"WORKSEMPNUM);" DISPLAY
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAYTO DISPLAY 0 .=
-"WORKS.EMPNUM)" DISPLAY" " COMPUTE count1 = -1
count2 java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 COMPUTE count3 = -1 COMPUTE count41 COMPUTE count5 = -1 EXECSQLDISPLAY ------------ "Your answeris:" SET" ,count1
WHERE PNUM ''DISPLAY ,
- - -- -- java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 EXECMOVEflag MOVE SQLCODED" HOURS java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
1 flag
WHERE DISPLAY"SELECT COUNT* ( NOT =2 count5 =)then
WHERE STAFF. DISPLAY"SELECT COUNT*)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
SQLCODE SQL-COD EXECDISPLAY"WHERE STAFF.EMPNUM=
WHERE NOTIN( HOURS
WHEREDISPLAY" " MOVEDISPLAY"dml062.pco ** *** " EXECSELECT) INTOFROMjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
WHERE( * WORKS " WHERE 40 NOT IN (SELECT HOURS FROM WORKS"
STAFF.) java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
EXECSELECTCOUNT* INTO:ount5 FROM STAFF
==============="
WHERE HOURSjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVE EXEC" WORKS.);" MOVE SQLCODE TO
DISPLAY" count1 = 5" DISPLAY" DISPLAY" count3 = 2" DISPLAY" count4 = 2" DISPLAY" count5 = 3" DISPLAY" Your answer is :" DISPLAY" count1 = ", count1 " count2 = ",count2 DISPLAY count4= - DISPLAY" count4 = ", count4 DISPLAY" count5 = ", count5 MOVETO if (count1 SETHOURS
PNUM ''OREMPNUME4 END-EXEC
1 TOflag EXECSQLCOUNT(*) :count1FROMSTAFF ifNOT = 2 OR count5 = 3) then MOVE 1 TO flag END-IF if (lag 0) then DISPLAY" *** pass *** "
WHERE 40 IN( HOURS FROM WORKS
VALUES WHERE.EMPNUM =WORKS) END-EXEC TOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 else DISPLAY" dml062.pco *** fail *** " EXECSQL WHERENOT (SELECTHOURSFROM WORKS
('0279','fail''PCO'END-EXEC ADD 1 TO MOVE SQLCODEEXECSQLCOUNT(*) INTOcount4 STAFF END-IF DISPLAY"========= WHERE = 40 ANDSTAFFEMPNUM = WORKS.EMPNUM) END-EXEC
EXECSQL COMMIT WORK END-EXEC MOVETO SQL-COD
******************** 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.