**************************************************************** * * 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> * ****************************************************************
DECLARE
01 test1 PIC X(20). SECTION
01 count2
01 count3 PIC S9 *
01 count4 PIC S9(9) DISPLAY
1 count5 S9)DISPLAYLEADINGSEPARATE
1 count1 S9 SIGN* DATE 1989/07/21 EMBEDDED COBOL LANGUAGE
01 SECND1(9) DISPLAYSIGNLEADING.
1 SECND2 * This program was written by employees of NIST to test SQL
IC.
01 EMPN1 * NIST assumes no responsibility for any party's use of PICS9DISPLAYLEADING .
1 PIC X3.
01 uid PIC X(18).
( EXEC PIC LEADINGjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
L SEPARATE
010count1
1 PICjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0 ""uid
1 PIC(9)DISPLAYLEADING.
* date_time declaration *
01 PIC 6 PIC
PROCEDUREINTOFROM. END-EXEC
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
" loggedin not" uidx CALLSTOP MOVE
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 " if DISPLAY ID
# DISPLAYDISPLAYDISPLAYjava.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 22 STOP:
MOVE 0 MOVE 0 TO DISPLAY Reference java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
Rules-java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 ACCEPTDATE
9ID
Version " at : ""
D " 1')"
FROM ACCEPTINTO Date:TO-DAY:"THE-TIME
******************** BEGIN TEST0274 ******************* *COMMIT AND ROLLBACK across schemas
DISPLAY DISPLAYDISPLAYAA DISPLAY -----java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAY ; "- - - -- DISPLAY "AUTH_TABLEjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 DELETE java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
(') DISPLAY" DISPLAY " DISPLAYINSERTjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
1''; DISPLAY" " DISPLAY" DELETE FROM AA;" DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAY" - " SULLIVAN java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 DISPLAY VALUES-
DISPLAY" COMMIT EXEC SQL COMMIT WORK END- DISPLAYDELETEINTO DISPLAY .UTH_TABLE
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAY WORK SQL-COD
; DISPLAY" " DISPLAY (10,' * count1 " DISPLAYMOVE java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
:test1 EXEC SQLCODE
E SQLEND-EXEC MOVEjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
(0,Ajava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
( trust EXECFROM.java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
1'java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
SQL SQL-COD
SQL-COD SQL java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
SQLCODE EXECSQLMOVETO
SULLIVAN1DISPLAY
MOVE
: java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 64 MOVETO
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *COMMIT and ROLLBACK of multiple cursors ( = 2AND = DELETESULLIVAN1 MOVETOSQL-COD DISPLAYSQLINTO DISPLAY=2" DISPLAY" test1 = In God we "" " DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 DISPLAYDISPLAY java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
WORK WORKS1
VALUES('0274','pass', DISPLAY else ".pco *** fail *** " EXECSQL"
ES'PCO java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 ADD" EMPNUM = 'E9"
YWHERE
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 " DISPLAYReference.GeneralRules)"
DISPLAY MOVE"DECLARE java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
******************** END TEST0274 *******************
******************** BEGIN TEST0275 ******************* *COMMIT and ROLLBACK of multiple cursors
java.lang.StringIndexOutOfBoundsException: Range [11, 1) out of bounds for length 23 DISPLAY PNUM DISPLAYSQLCODE DISPLAY" TEST0275 count1 =-java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 DISPLAYOF DISPLAY" "UPDATE DISPLAY" " DISPLAY" DECLARE CHICHIMOVESQLCODE
E SQLDISPLAY' " CURRENT OF KING" DISPLAY" EXEC DECLARE CURSOR SELECTEMPNUMFROMSTAFF1 " COMMIT*FOR UPDATEUPDATE EMPNUM;
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 DISPLAY," *FOR UPDATE OF EMPNUM, PNUM;
PNUM
- " PROJ1"
PNUM DISPLAY*FOR UPDATE OF PNUM; .WORKS1 SQL java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 DISPLAY" UPDATE STAFF1"TO DISPLAY" SET EMPNUM ='E9" " WHERE CURRENT OF CHICHI;" DISPLAY"
LAYUPDATE DISPLAYFROM DISPLAYTO DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
" DISPLAY" EXEC SQL INSERT INTO PROJ1 DISPLAY CURRENT *FROMEND-EXEC DISPLAY" "EXECDECLARE E9 DISPLAY" COMMIT *FOR UPDATE OF EMPNUM; " DISPLAY EMPNUMSEMPNUM P9
* TODECLARE FROM " DISPLAY" PROJ1 *FOR UPDATE OF PNUM; DELETESTAFF1 MOVE SQLCODE TOTO DISPLAY" COMPUTE count1SET PNUMTO EXECSQL SQLCODE SQLjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 SELECT: SQL INTO END-EXEC
* END-EXEC TO INSERTINTOSTAFF1. AND
* PROJ SQLCODE MOVEEXEC UPDATE OFjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
W EMPNUM java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 *FOR UPDATE OF EMPNUM;
MAC
WHERE EMPNUM = 'E3'END-EXEC *FOR UPDATE OF EMPNUM, PNUM; EXECSQLSQL-CODTO
WHERE =P2 *FOR UPDATE OF PNUM;
TO" SQL SQLCODE TO
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TO EXECSQL FETCH,WORKS1java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 MOVETO SQL-CODMOVE EXEC MAC: END-EXEC MOVEPROJ1 =WORKS1"dml062pco * * " SQLKING MOVE SQLCODEEXECSQL STAFF1 SQL SETDELETE PROJ1
WHERE TO DELETE========java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
UPDATE SET EMPNUMjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
WHERE "count1 =1java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
SQL-COD SQL SET PNUM19 6java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
WHERE--- *" DISPLAY"
EXEC COMMIT ---- - " DISPLAY SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 DISPLAYINTOjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
STAFF1AND
STAFF1.EMPNUMMjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
. ; MOVE SQL MOVESQLCODESQL-COD TO EXECSQL (12,'' MOVE SQLCODE EXEC WORKS1 *View across schemas
SQLCODESECOND2 DISPLAY" BY END-EXEC DISPLAY" count1java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 34
9 " " ="count1
ifSQL:,java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 DISPLAY" *** SQL CLOSE PIGGY EXECDISPLAY"" " INTOEXEC ROLLBACK WORKEND-EXEC
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 else DISPLAY" dml062.pco *** fail *** " DISPLAY=
VALUESSECND2
errcnt
= ,java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 SQL .AUTH_TABLE
WORK MOVEINSERT .AUTH_TABLE
******************** END TEST0275 *******************
******************** BEGIN TEST0276 ******************* *View across schemas
DISPLAY"ReferenceDISPLAY *pass**java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
-06,pass MOVETO DISPLAY DISPLAY" - - - - - - - - - - - - EXEC INSERT INTO TESTREPORT
DISPLAY FETCH: SECND2
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAY" INSERT INTO ROLLBACKWORK DISPLAY 1A; 1 java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 DISPLAY" " DISPLAYDECLARE DISPLAY" SELECT EMPNUM,SECOND2 FROM "" DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 EXECDISPLAY" MOVETO EXECSQLINSERTINTOSECND1 SECND1
VALUES (12,'A' MOVE"SECND2 = "
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 SELECT = END-IF EXECOPENEND-EXEC
valued =1 EXECSQL FETCH MOVE ( =" A" java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 EXEC PIGGY, END-EXEC MOVEsection EXECD ------------
EXECDISPLAY .1General
DISPLAYelse" DISPLAY"EXEC INSERT INTOTESTREPORT " A
EMPN2java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 DISPLAYSECND2 SELECTcount1
Y"java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAY" =" EMPN1 0( java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
DISPLAY WORK DISPLAY" EMPN2 = ", EMPN2 DISPLAY" SQLCODE SQL-COD MOVE 0 HOURS
COMPUTE flag
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 if*IN is a 3-valued predicate, EXISTS is 2-valued =ANDjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 COMPUTE = + 1 section"
if (SECND1 = "A"AND WORKS
=java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 DISPLAY = NULL"UPDATEWORKSjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
VALUES " MOVETO else "dml062pco* fail 40 (SELECT WORKS EXECSQLINSERT STAFFWHEREHOURS
VALUES(- EMPNUM "" TO "WHERE4NOTIN(ELECT HOURS FROM WORKS" DISPLAY"============================"
EXEC WORK TO
******************** END TEST0276 *******************
******************** BEGIN TEST0279 ******************* *IN is a 3-valued predicate, EXISTS is 2-valued
DISPLAY" IN is a 3- - ;java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 DISPLAY 2 DISPLAY" section 5.13 General Rules "
= - "--------- " DISPLAY" TEST0279 "
WHERE =P5 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 " " DISPLAY" "
ISPLAYNULL DISPLAY" WHERE PNUM = 'P5' OR 2then DISPLAY"MOVETO
(ifNOT
1
(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 DISPLAYMOVE TO
- " WORKS 40 SELECT FROM WORKS
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 DISPLAYINTO java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 DISPLAYINFROM ADD WHERESTAFF =WORKS
- " WORKS.EMPNUM);" " DISPLAYSQL() :ount5
============java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 DISPLAY" SQLCODESQL-COD
-EMPNUM DISPLAY" "
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 STOP DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
- " WORKS.EMPNUM);" DISPLAY" " COMPUTE count1 = -1 COMPUTE count2 = -1 COMPUTE count3 = -DISPLAY , COMPUTE - COMPUTE count5 "count4 EXECSQL UPDATE WORKS 0 flag SET = NULL
WHERE =P5 = '' MOVE SQLCODE MOVE SELECTINTOEND-EXEC MOVE SQLCODE TO (count4ORNOTjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 EXECSQLSELECTf =0 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
WHERE SELECTjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
STAFF .EMPNUM MOVE SQLCODE TO SQL-COD EXECSQL java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
40 INFROM
WHERE STAFFVALUES') MOVE1 errcnt SELECT : FROM
WHERE
HOURS .WORKS MOVE SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
SQLCODE
WHERE HOURS = 40 AND STAFF MOVE SQLCODE EXECSQL**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 MOVE SQLCODE TO DISPLAY" The correct answer is :" DISPLAY" count1 = 5" DISPLAY" count2 = 2" DISPLAY" count3 = 2" DISPLAY" count4 = 2" DISPLAY" count5 = 3" DISPLAY" Your answer is :" DISPLAY" count1 = ", count1 DISPLAY" count2 = ", count2 DISPLAY" count3 = ", count3 DISPLAY" count4 = ", count4 DISPLAY" count5 = ", count5 MOVE 0 TO flag if (count1 NOT = 5 OR count2 NOT = 2 OR count3 NOT =
2) then MOVE 1 TO flag END-IF if (count4 NOT = 2 OR count5 NOT = 3) then MOVE 1 TO 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.pco *** fail *** " EXECSQLINSERTINTO TESTREPORT
VALUES('0279','fail','PCO') END-EXEC ADD 1 TO errcnt MOVE SQLCODE TO SQL-COD END-IF DISPLAY"==============================================="
EXECSQL COMMIT WORK END-EXEC MOVE SQLCODE TO SQL-COD
******************** END TEST0279 *******************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
* **** Procedures for PERFORM statements
blue'>" 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.
* **** Procedures for PERFORM statements
¤ Dauer der Verarbeitung: 0.20 Sekunden
(vorverarbeitet)
¤
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.