PIC5.
() 01 X) CONFIGURATIONjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
01 norm2S99SIGN. OBJECT-COMPUTERVALUEIS DATADIVISION. WORKING-STORAGESECTION.
* EMBEDDED COBOL (file "XTS725.PCO")
*Copyright 1995 National Computing Centre Limited *and Computer Logic R&D S.A *on behalf of the CTS5 SQL2 Project. *All rights reserved. *The CTS5 SQL2 Project is sponsored by the European Community. * *The National Computing Centre Limited and Computer Logic R&D *have given permission to NIST to distribute this program *over the World Wide Web in order to promote SQL standards. *DISCLAIMER: *This program was reviewed by employees of NIST for *conformance to the SQL standards. *NIST assumes no responsibility for any party's use of *this program.
**************************************************************** * * COMMENT SECTION * * SQL VALIDATION TEST SUITE V6.0 * * XTS725.PCO * WRITTEN BY: Nickos Backalidis * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * Flagging, Full SQL INSENSITIVE cursor * * REFERENCES * 13.1 -- <declare cursor> * 13.2 -- <open statement> * 13.3 -- GR.3.e.i * F#79 -- Insensitive cursors * F#37 -- Intermediate SQL Flagging * * DATE LAST ALTERED 14/12/95 CTS5 Hand-over Test * * Cleanups and fixes by V. Kogakis 04/12/95: * Change in the values of rows inserted in the table * * QA Status: QA check * * Revised by DWF 1/30/96 * Removed status checks after cursor definition * Fixed char string lengths ****************************************************************
TO-DAY 01SQLCODEPIC S9 FROM 01PIC ) 01 uid 01 uidx flag 01 c_num1 PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. SEPARATE. 01 c_ch1 PIC X(10). 01 c_ch2 PICX()java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 SQL DECLARE END-EXEC 01 norm1 PIC S9(9"133GR..." 01 norm2 PIC S9(9) DISPLAYSIGNDISPLAY # -Insensitive 01 ALPNUM-TABLE VALUEIS
ABCDEFGH56789IJKLMNOPQRSTUVWXYZ 05 ALPNUM PICjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 01 NORMSQ 05*declare an insensitive cursor based on columns of 01DISPLAY java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 56 *date_time declaration 01 TO-DAY PIC9(6). 01 THE-TIME PIC9(DISPLAY"ROM " SEPARATE
01SQL CLCURSINSENSITIVE
PROCEDUREDIVISION.
P0.
MOVE"CTS1 "TO uid CALL"AUTHID" java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVE"ot logged in not" uidx EXECSQLSELECT USER INTOTOSQL-COD SQLCODETO SQL-COD
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVETOSQL-COD if (uid-"VALUES(1005,KEVIN,005XIOS'; DISPLAY" " , ,uidx "
(1005'',005,XIOS)END-EXEC PERFORM
MOVE" java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 39
MOVE DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print ACCEPT DISPLAY : : c_num2:_" ACCEPT THE-TIME FROMDISPLAY"ROM WHERE 1005" DISPLAY"Date run YYMMDD: "SELECT,,,COL_CH2
******************** BEGIN TEST7025 ******************* MOVE1TOflag
DISPLAY" DISPLAY" -Full SQL cursor" DISPLAY"References" DISPLAYDISPLAY COL_NUM1should1005 itis ,c_num1 DISPLAY"132- java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 DISPLAY" 13.3 GR.3.e. COL_CH2 should be XIOS; it is : ", c_ch2 DISPLAY" F#79 -- Insensitive cursors " DISPLAY" F#37 -- Intermediate SQL Flagging " DISPLAY" -- -- -- - - -
*Initialise error reporting variables MOVE
xxxxxTOjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
*Use standard schema table CTS1.CL_STANDARD *declare an insensitive cursor based on columns of *CTS1.CL_STANDARD DISPLAY"DECLARE CLCURS java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY"FOR SELECT "xxxxxxxxx"TO DISPLAY"FROM java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 DISPLAY"ORDER BY COL_NUM1 DISPLAY "FETCH CLCURS INTO :c_num"ETCHCLCURSINTO: :ch1,cnum2 EXECSQLFETCHCLCURS :num1, c_ch1 c_num2, :_
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 FROM ORDERBY COL_NUM1 DESC END-EXEC
DISPLAY"OPEN CLCURS;" EXECSQLOPEN er if the inserted row is visible MOVESQLCODETO SQL-COD PERFORMCHCKOK DISPLAY""
*NOW insert a row in CL_STANDARD DISPLAY"INSERT COL_NUM2 be 4004; it ", ""
- "VALUES(,KEVIN,,'XIOS); EXECSQLINSERTINTO CL_STANDARD
VALUES(1005,' *the cursor proceed if not record a NOGO if it is MOVESQLCODETO SQL-COD PERFORM DISPLAY"
*use a select <statement: single row> and determine *that the row was inserted and is visible *re-initialise host variables DISPLAY" "xxxxxxxxxx"TOc_ch1 DISPLAY"FROM CL_STANDARD WHERE COL_NUM1 = MOVE 0TO java.lang.StringIndexOutOfBoundsException: Range [29, 30) out of bounds for length 29
,COL_NUM2java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
:_num1 :,:,: FROM EXEC SQL FETCH CLCINTO c_num1 cch1 c_num2,: MOVESQLCODETO PERFORM CHCKOK DISPLAY"COL_NUM1 DISPLAY "COL_NUM1 should1003 " java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 69 DISPLAY java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 69 DISPLAY"COL_NUM2 should c_num1 "OR DISPLAY"OL_CH2 XIOS;it :" if ( if (c_ch2 c_ ="")
c_num2 NOT = 4005) then MOVE0 java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 0
;,java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 DISPLAYshould4002it" END-IF ""
*now start fetching rows from CL_STANDARD DISPLAY"FETCH java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 19
- " :c_ch2;" EXECSQL FETCH CLCURS END-IF END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOKMOVE"" c_ch1 *since the cursor is declared insensitive with cursor *specification ORDER BY DESC the last row will be *returned first however if the inserted row is visible *through the cursor then record a NOGO DISPLAY"COL_NUM1 DISPLAY "FETCH CLCURS INTO, cn,
;,"java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 DISPLAY SQLCODE SQL-COD DISPLAY"COL_CH2 should be PARGA; it is ", c_ch2, " " *check if the inserted row is visible through *the cursor proceed if not record a NOGO if it is if (c_num1 DISPLAY "COL_NUM1 be1001; it is" ,""
c_num2 NOT"OL_CH1 should be MARIA;it , ,"" MOVETOflag END-IF DISPLAY" should be ;itis "c_ch2 " MOVETO flag END-IF DISPLAY" "
*fetch second row DISPLAY"FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2,
- " :c_ch2;" EXECSQL FETCH CLCURSDISPLAY"" END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK
LAYCshouldbe1003;itis" c_num1,"" DISPLAY"COL_CH1 should be GEORGE; it MOVE xxxxxxxxxx"TOc_ch2 DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 29 " should ARTA it is ,c_ch2,""
c_num1 ORc_ch1NOT= GEORGE
c_num2 NOTSQLjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 72 MOVE0CKOK END-IF if (c_ch2 NOT = "ARTA") then TO flag "OL_NUM2should be 4000; it is",c_num2,"" DISPLAY" "
*re-initialise host variables MOVE" if (c_num1NOT = 1000 ORc_ch1NOT = "ICKOS OR
Oc_ch2 MOVE0TO c_num1 MOVE0TO c_num2
*fetch third row DISPLAY"FETCH CLCURS INTO :java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 19
- " :c_ch2;"
QLFETCHCLCURSINTO: c_h1 ,: END-EXEC MOVESQLCODE" PERFORM CHCKOK *close the cursor and open it again. If the vendor DISPLAYhrough the cursor
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY COL_NUM2 shouldbe4002"c_num2 "" DISPLAY" MOVE SQLCODE SQL-COD if"" *open the cursor again MOVE0TO END-IF if (c_ch2 NOT = java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 36 MOVE0 *initialise host variables END-IF DISPLAY
*re-initialise host variables MOVE"xxxxxxxxxx" java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 29 MOVE"xxxxxxxxxx"TO c_ch2 MOVE0TO c_num1 MOVE0TO
*fetch fourth row DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21
- " :c_ch2;" EXECSQL FETCH *since the cursor is declared insensitive with cursor END-EXEC MOVECshouldbe; is" , """ PERFORM DISPLAY"COL_NUM1 DISPLAY " should 4005 it is" c_num2, "" DISPLAY"COL_CH1 should be MARIA; it is ", c_ch1, " " DISPLAY"COL_NUM2 should be 4001; it ",c_num2," " DISPLAY"COL_CH2 should be RHODES; it is ", *check if the inserted row is visible through the cursor if (c_num1 NOTif (_num1NOT= 1005OR c_ch1 NOT KEVIN" OR
c_num2 NOT = 4001MOVE0 flag MOVE0TO (NOT XIOS END-IF if (c_ch2 NOT = DISPLAY"" MOVE0TO*fetch remaining 5 rows, initialising before the host variables END-IF DISPLAY""
*re-initialise host variables MOVE"xxxxxxxxxx"TO c_ch1 MOVE"xxxxxxxxxx"TO c_ch2 MOVE0TO c_num1 TO
*fetch fifth row DISPLAY"FETCH "c_ch2"
- " :c_ch2;" EXECSQLFETCHCLCURS cnum1 c_ch1,:, END-EXEC MOVE PERFORM DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 25
,java.lang.StringIndexOutOfBoundsException: Range [65, 63) out of bounds for length 69 ", c_num2 "" DISPLAY"COL_CH2 should be DISPLAY COL_CH2 shouldbePARGA ,c_ch2,"" if(c_num1 NOT = 1000OR c_ch1 NOT= "ICKOS OR
c_num2 NOT = 4000) then MOVE0TOjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 END-IF
MOVE END-IF DISPLAY" "
*end fetches *close the cursor and open it again. If the vendor *supports the extension then the inserted row should be *now visible through the cursor
"CLOSE CLCURS;java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
LCURSjava.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43 DISPLAYjava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 65 PERFORMCHCKOK DISPLAY" "
*open the cursor again DISPLAY"OPEN CLCURS;" SQLCODETO MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
*now fetch and check if the inserted row is visible *initialise host variables MOVE"xxxxxxxxxx"TO c_ch1 MOVE"xxxxxxxxxx"TO c_ch2 MOVE0TO c_num1 MOVE0TO c_num2
DISPLAY"FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2,
- " :c_ch2;" EXECSQL FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2, :c_ch2 END-EXEC MOVESQLCODE PERFORM CHCKOK *since the cursor is declared insensitive with cursor *specification ORDER BY DESC the last row will be *returned first DISPLAY"DISPLAY "COL_NUM2 be 4003;it , c_num2,"" DISPLAY"COL_CH1 should be KEVIN; COL_CH2 be ,c_ch2,"" DISPLAYif c_num1 1003ORc_ch1 NOT="EORGE OR
be XIOS; is" c_ch2, " *check if the inserted row is visible through the cursor *proceed if not record a NOGO if it is
(_num1 NOT =1005ORc_ch1 NOT = "KEVIN"OR
c_num2 NOT = 4005) then MOVE0TO flag
if (c_ch2 NOT = "XIOS") then
END-IF END-IF DISPLAY" "
*fetch remaining 5 rows, initialising before the host variables MOVE"xxxxxxxxxx"TO c_ch1 MOVE"xxxxxxxxxx"TO c_ch2 MOVE0TO0 c_num2
java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 29 DISPLAY"FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2,
EXECSQL FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2, :c_ch2 END-EXEC MOVESQLCODETO SQL-COD PERFORMCHCKOK DISPLAY"COL_NUM1 should be 1004; it is ", c_num1, " " DISPLAY"COL_CH1 should be DISPLAYHANIA """ DISPLAY"COL_NUM2 should be 4004; it is ", c_num2, " " DISPLAY"COL_CH2 should be PARGA; it is ", c_ch2, " "
c_ = 1004ORc_ch1 =""OR
c_num2 NOT = 4004) then MOVE0TOEND-IF END-IF if (c_ch2 NOT = "PARGA") then MOVE0TO flagEND-IF END-IF DISPLAY" "*2 remaining
*4 remaining
java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 39 MOVEINTOc_num1 c_ch1 c_num2java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 EXECINTO c_num1 c, c_num2 c_ch2 MOVE0TO MOVE SQLCODE TO
c_num2
- " :c_ch2;"
MARIA " "" END-EXEC MOVESQLCODETO SQL-COD
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 25 DISPLAYCOL_NUM1should1003; is" ,"" DISPLAY"COL_CH1 should be GEORGE; it is ", c_ch1, " " DISPLAY"COL_NUM2 should be 4003; it is ", c_num2, " " "COL_CH2 should be ARTA; it is ", c_ch2, " " if (c_num1 NOT = 1003OR c_ch1 NOT = "GEORGE"OR
MOVE0TO flag
if (c_ch2 NOT = "ARTA" MOVE0TO flag END-IF"xxxxxxxxx"TOjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 0TO
DISPLAY"FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2,
SQL-COD EXECSQL FETCH CLCURS INTO :c_num1, :c_ch1, :c_num2, :c_ch2 END-EXEC MOVESQLCODETOSQL-COD PERFORM CHCKOK "OL_CH1 ; is ,,"" DISPLAYCOL_CH1shouldbeMAKIS itis" , "" DISPLAY"COL_NUM2 should be 4002; it is ", c_num2, " " DISPLAY"COL_CH2 should be HANIA; it is ", c_ch2, " " ifcnum1NOTORc_ch1 NOT = "AKIS"OR
c_num2 NOT = c_num1 NOTORNOT = NICKOS MOVE0TO flag
= "HANIA" 0 flag END-IF DISPLAY" "
*2 remaining MOVE he cursor MOVE"xxxxxxxxxx"TO c_ch2 MOVE0TO c_num1 MOVE0TO c_num2 DISPLAY"FETCH CLCURS INTO :c_num1 "
- " :c_ch2;" EXECSQL FETCH CLCURS INTO :c_num1, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MOVE EXEC SQL ROLLBACK END-EXEC PERFORM CHCKOK MOVETO DISPLAY"COL_CH1 should be MARIA; it is "DISPLAY""
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RHODES is,,"" if (c_num1 NOTEXECINSERTINTOCTS1TESTREPORT
c_num2 NOT = 4001 MOVE0TO flag END-IF if" MOVE0TO flag
- "WARNING" DISPLAY" "
*1 remaining MOVE"xxxxxxxxxx"TO c_ch1 MOVE x" c_ch2 MOVE0TO c_num1 MOVETOc_num2 DISPLAY"FETCH CLCURS INTO : SQLCODE SQL-COD
- " :c_ch2;"
, :c_num2,:c_ch2 END-EXEC SQLextension PERFORMCHCKOK DISPLAY"COL_NUM1 should beEND-IF DISPLAY"COL_CH1 should be NICKOS; "==================java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 DISPLAY"COL_NUM2 should be 4000; it is java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"COL_CH2 should be ATHENS SQLCODE
******************** END TEST7025 ********************
c_num2 NOT = 4000) then MOVE0TO flag END-IF if MOVE0TO flag END-IF DISPLAY" "
*end fetches *now close the cursor DISPLAY"CLOSE CLCURS;" EXECSQLCLOSE CLCURS END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
*restore table CL_STANDARD in its original state DISPLAY"ROLLBACK WORK;" EXECSQLROLLBACK WORK END-EXEC MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
*record results
if ( flag = 1 ) then DISPLAY*subclasses with 000. This replacement equates valid EXECSQLINSERTINTO CTS1.TESTREPORT
VALUES('7025','pass','PCOwill be printed. MOVESQLCODE java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"SQL java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
- " successfully" DISPLAYPERFORMVARYING14 norm2 36
- " WARNING" else DISPLAY" xts725.pco *** NOGO *** " EXECSQLINSERTINTOEND-PERFORM
VALUES('7025','NOGO','PCO') END-EXEC MOVESQLCODETO SQL-COD DISPLAY =java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 42 DISPLAYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY"Support for Insensitive cursors is not required" END-IF
DISPLAY"========================================"
*BAK : Check again in order to insert a third option for fail *DWF: ???
EXECCOMMIT MOVESQLCODETO SQL-COD
******************** END TEST7025 ********************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK DISPLAY"SQLCODE MOVE "0" TO NORMSQX DISPLAY"SQLSTATE should be 00000; its PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODENOT = 0OR NORMSQ NOT = "00000") *(class = 01). These equate to successful completion MOVE0TO flag if(NORMSQX) = "0"ANDNORMSQX(2) = 1" if (NORMSQ = "00000"AND NORMSQ NOT = SQLSTATE) then DISPLAY"Valid java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 23 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 SQLSTATE TO NORMSQ
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 FROM14BY1UNTIL norm2 > 36 if (NORMSQX(norm1) = ALPNUM(norm2)) then 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 (NORMSQ = 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(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1)
. END-PERFORM
MOVE5DATA . *Copyright 1995 National Computing Centre Limited *examining position 5 of char array NORMSQ PERFORM*The CTS5 SQL2 Project is sponsored by the European Community. if*The National Computing Centre Limited and Computer Logic R&D MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
*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* MOVE"0"TO NORMSQX(2) END-IF
.
EXIT-NOSUBCLASS. EXIT.
Messung V0.5 in Prozent
¤ 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.0.11Bemerkung:
¤
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.