IDENTIFICATIONDIVISION. PROGRAM-ID. XTS728. ENVIRONMENTDIVISION. CONFIGURATIONSECTIONPROGRAM-ID XTS728ENVIRONMENTDIVISION. SOURCE-COMPUTER xyz OBJECT-COMPUTER. SOURCE-COMPUTERxyz OBJECT-COMPUTERxyz DIVISION. DATADIVISIONjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *****************************************************************
* Standard COBOL (file "XTS728.SCO") calling SQL * procedures in file "XTS728.MCO".
*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 * * XTS728.SCO * WRITTEN BY: Nickos Backalidis * TRANSLATED AUTOMATICALLY FROM EMBEDDED COBOL BY CHRIS SCHANZLE * * Flagging Full SQL - <null predicate> with two-col row * * REFERENCES * 8.6 -- <null predicate> * 7.1 -- <row value constructor> * 7.1 LR.1a -- Intermediate SQL restriction which prohibits * the use of more than one <row value * constructor element> in a <row value * constructor> that is not simply contained in * a <table value constructor> * F#37 -- Intermediate SQL Flagging. * * DATE LAST ALTERED 12/12/95 CTS5 Hand-over Test * * Cleanups and fixes by V. Kogakis 04/12/95 * * QA Status: QA Check * * Revised by DWF 1996-02-01 * Fixed char string lengths * Deleted extraneous reference to 7.1 SR.1 * Removed CHCKOK after no data delete ****************************************************************
* EXEC SQL BEGIN DECLARE SECTION END-EXEC
01 SQLCODE PIC S9(9) COMP.
01 SQLSTATE PIC X(5).
01 uid PIC X(18).
024.
0 PIC(0.
0 c_ch2java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 * EXEC SQL END DECLARE SECTION END-EXEC
01 norm1 *date_time declaration
0 PIC(9) LEADING.
01 ALPNUM-TABLE0THE-TIME "01 1 PIC S9(9)DISPLAY LEADING SEPARATEjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
0 PICOCCURS.
01 NORMSQ.
05 java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
0errcnt() DISPLAYLEADING. *date_time declaration
01TO-DAY
01 THE-TIME PIC 9( " logged in, "TO
01 flag SQLCODE java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
01 SQL-COD * EXEC SQL ROLLBACK WORK;CALL SQLCODE
PROCEDUREi uid) then
0
"connectedjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 CALL" uid MOVEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 * EXEC SQL SELECT USER INTO :uidx FROM CTS1.ECCO;
5-ID " Version #" MOVEFROMDATE * EXEC SQL ROLLBACK WORK; CALL"SUB2"USING SQLCODEACCEPTFROMTIME
if (uid NOT =java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 0
: ",uid, ". User- >
-"" STOPRUN END-IF
errcnt
DISPLAY"SQL Test Suite, V6.0, Module COBOL, xts728 "ofthan< value DISPLAY "9 " DISPLAYDISPLAY atable *date_time print
TO-DAY DATE ACCEPT THE-TIME FROMTIME DISPLAY"------- --------- -java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
******************** BEGIN TEST7028 ******************* MOVE 1 TO flag "xxxxx"TO DISPLAY" TEST7028" DISPLAY" Flagging, DISPLAY"DELETE CTS1;
- " two-col row" DISPLAYReferences DISPLAY" 8.6 -- " DISPLAY .- row DISPLAY*execute the following query
- " prohibits" DISPLAY" the use of more than one
- java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY C1 NULL
- " constructor> that is not" DISPLAY" simply
- " constructor>" DISPLAY" F#37 -- Intermediate SQL Flagging." " -- --- --------- ---- "
*Initialise error reporting variables COMPUTESQLCODE = -java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 MOVE xxxxx SQLSTATE
*use tables TABLE728a and TABLE728b from the standard schema *Make sure that table728b is empty DISPLAY"DELETE FROM CTS1.TABLE728b;" * EXEC SQL DELETE FROM CTS1.TABLE728b; CALL"SUB3"USING SQLCODE SQLSTATE "xxxxxxxxxx"TO MOVE SQLCODE TO SQL-COD
*execute the following query *if a syntax error does not occur then all the *columns of TABLE728a that are not NULL * *will be copied in TABLE728b DISPLAY"INSERT INTO CTS1.TABLE728b" DISPLAYSELECT." DISPLAY* EXEC SQL SELECT COL_1,COL_2 INTO :c_ch1,:c_ch2 * EXEC SQL INSERT INTO CTS1.TABLE728b * SELECT * FROM CTS1.TABLE728a * WHERE (C1,C2) IS NOT NULL; CALLSUB4 SQLCODE MOVE SQLCODE TO SQL-COD PERFORM DISPLAY" "
*Use two select statement(s):single row and examine the *contents of table CTS1.728b *1st select DISPLAY"SELECT COL_1,COL_2 INTODISPLAY "OL_2;its, java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 DISPLAYFROM" DISPLAY"WHERE COL_1 = 'NICKOS' AND COL_2 = 'GEORGE'; then * EXEC SQL SELECT COL_1,COL_2 INTO :c_ch1,:c_ch2 * FROM CTS1.TABLE728b * WHERE COL_1 = 'NICKOS' AND COL_2 = 'GEORGE'; CALL 0 TO MOVE SQLCODE java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 PERFORM CHCKOK DISPLAY"COL_1 should be DISPLAY "SELECT COL_1,COL_2INTO:, :c_ch2"
COL_2 be; its is",c_ch2 if (c_ch1DISPLAY WHEREHARRY =TANIA * EXEC SQL SELECT COL_1,COL_2 INTO :c_ch1,:c_ch2 MOVE 0 TO* WHERE COL_1 = 'HARRY' AND COL_2 = 'TANIA'; END-IF DISPLAY" "
*2nd SELECT DISPLAY"SELECT COL_1,COL_2 INTO :c_ch1 DISPLAY COL_2shouldbeTANIA " _ch2 DISPLAY"FROM CTS1.TABLE728b" DISPLAYWHERE TANIA * EXEC SQL SELECT COL_1,COL_2 INTO :c_ch1,:c_ch2 * FROM CTS1.TABLE728b * WHERE COL_1 = 'HARRY' AND COL_2 = 'TANIA'; CALL"SUB6"USING SQLCODEEND-IF DISPLAY ; PERFORM* EXEC SQL ROLLBACK WORK; DISPLAY"COL_1 should be HARRY; its value is ", c_ch1 DISPLAY"COL_2 should be TANIA; its MOVE TO SQL-COD if( NOT ="HARRY"OR c_ch2 ="") then"" MOVE END-IF DISPLAY ( flag ) then
if executed DISPLAY mco *" * EXEC SQL INSERT INTO CTS1.TESTREPORT * VALUES('7028','pass','MCO'); CALL"SUB8"USING" xts728.mco * **" MOVE SQLCODE TO SQL-COD DISPLAY"Intermediate SQL * VALUES('7028','NOGO','MCO'); "Null redicate with two-col row" DISPLAY"executed successfully." DISPLAYVendor Flagger
- " WARNING"
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 DISPLAYxts728 * " * EXEC SQL INSERT INTO CTS1.TESTREPORT * VALUES('7028','NOGO','MCO'); CALL"SUB9"USING SQLCODE SQLSTATE
-"required" DISPLAYEND-IF DISPLAYIntermediate extension DISPLAY"Support with two-col row is not
- " required" END-IF DISPLAY"============= SQLCODE TO SQL-COD
* EXEC SQL COMMIT WORK; CALL"SUB10"USING SQLCODE ******************** END TEST7028 ******************** MOVE SQLCODE TO SQL-COD RUN ******************** END TEST7028 ********************
**** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN CHCKOK
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK. DISPLAY NOSUBCLASS EXIT-NOSUBCLASS DISPLAY" should be 00000; its is ", SQLSTATE
NOSUBCLASS EXIT-NOSUBCLASS ifjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 MOVE 0 TO flag END-IF if"Valid implementation-defined SQLSTATE accepted." then DISPLAY" . 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
MOVEMOVETO NORMSQ *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORM norm2 14BY norm2>3 if (NORMSQX(norm1) = ALPNUM *subclass begins in position 3 of char array NORMSQ MOVE"0"TO NORMSQX VARYINGFROM4BY norm2>36 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)
GOTO END-IF
MOVE 4 TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 FROM 1 BY 1 (NORMSQ) then
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVE" (norm1) END-IF END-PERFORM
MOVE 5 TO norm1 VARYINGnorm2 BYUNTIL > 3java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROM 1 BY 1 UNTIL norm2 > java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
m1=(norm2then MOVE"0"TO NORMSQX *valid characters are 0-9, A-Z 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 (NORMSQX(1) = "0"AND NORMSQX(2) = "1") then MOVE"0"TO NORMSQX(2) END-IF
.
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.