.
.. DIVISION CONFIGURATION..
. .
. . DATA WORKING-STORAGESECTION.
* 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( * a <table value constructor>
01 SQLSTATE PIC*
01 uid PIC X(18).
01 uidx PIC X(18).
01 c_ch1 PIC X(10).
01 c_ch2 PIC X(10). * EXEC SQL END DECLARE SECTION END-EXEC
01 norm1 *
01 norm2 PIC S9(9) DISPLAYSIGN* Deleted extraneous reference to 7.1 SR.1
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "13ABCDEFGH56789IJKLMNOPQRSTUVWXYZ"
01c_ch1 X(1).
0 1 c_ch2 PIC X(10).
05 NORMSQX PIC X OCCURS 5 TIMES.
01 errcnt PIC S9(9) DISPLAYSIGNLEADINGSEPARATE. *date_time declaration
01 TO-DAY PIC 1norm2 S9 DISPLAYSIGNSEPARATE
1 PIC 9(8).
01 flag DISPLAYSIGN.
01 SQL-COD PIC S9(9) DISPLAYSIGNLEADING 5ALPNUM X 36 TIMES
DISPLAY"SQL Test Suite, V6.0, Module COBOL, xts728.sco" DISPLAY "9-yte " DISPLAYTEd *date_time print ACCEPT TO-DAY java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
THE-TIMETIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff
******************** BEGIN TEST7028 ******************* MOVE 1 TO flag DISPLAY" TEST7028" DISPLAY" Flagging,Full SQL, with
- " two-col row" DISPLAY" References " DISPLAY" 8 DISPLAY"ERRORUser uid expected User ", uidx, " DISPLAY" 7.1 --
- connected
- " MOVE0TOjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 DISPLAYthe use more one row
- " constructor" DISPLAY" element> in a
- " 5-byteID" " simplycontained in < value
- " constructor>" DISPLAYACCEPTFROM java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 DISPLAY - ---- "
*Initialise error reporting variables COMPUTE SQLCODE =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 MOVE" SQLSTATE
*use tables TABLE728a and TABLE728b from the standard schema *Make sure that table728b is empty FROM.TABLE728b" * EXEC SQL DELETE FROM CTS1.TABLE728b; CALL"SUB3"USING" References " MOVE SQLCODE " 7. -< value constructor>"
*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-"constructor" DISPLAY"SELECT * FROM CTS1.TABLE728a" DISPLAY"WHERE(,C2) IS NOTNULL;" * EXEC SQL INSERT INTO CTS1.TABLE728b * SELECT * FROM CTS1.TABLE728a * WHERE (C1,C2) IS NOT NULL; DISPLAY-- -
SQLCODE 1 PERFORMMOVE""TO DISPLAY" "
*Use two select statement(s):single row and examine the *contents of table CTS1.728b *1st select DISPLAY*if a syntax error does not occur then all the DISPLAY*will be copied in TABLE728b " * FROM CTS1TABLE728a * EXEC SQL SELECT COL_1,COL_2 INTO :c_ch1,:c_ch2 * FROM CTS1.TABLE728b * WHERE COL_1 = 'NICKOS' AND COL_2 = 'GEORGE'; CALL""USING SQLSTATE MOVE CHCKOK PERFORM DISPLAY*contents of table CTS1.728b DISPLAY" should be GEORGE its value is ",c_ch2 if (c_ch1 DISPLAY" CTS1.TABLE728b
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 MOVE flag END-IF DISPLAY""
*2nd SELECT
c_ch1 DISPLAY"FROM DISPLAY" should GEORGE value DISPLAY" COL_1 = 'HARRY' AND COL_2 ='';" * 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 MOVEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 PERFORM CHCKOK ""TO
*2nd SELECT " ;itsvalueis"cjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 if" COL_1 = 'HARRY'ANDCOL_2='';" then * WHERE COL_1 = 'HARRY' AND COL_2 = 'TANIA'; END-IF DISPLAY" "
DISPLAY"ROLLBACKWORK" * EXEC SQL ROLLBACK WORK; CALL"SUB7"USING
SQLCODE
c_ch1 HARRY NOT TANIA DISPLAY"
*record results
if = 1java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 * EXEC SQL ROLLBACK WORK; * EXEC SQL INSERT INTO CTS1.TESTREPORT * VALUES('7028','pass','MCO'); ""USING MOVETO DISPLAYSQL
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" successfully." " xts728. *** pass** "
- &nsp; 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
.
EXIT-NOSUBCLASS. EXIT.
¤ Dauer der Verarbeitung: 0.12 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.