**************************************************************** * * COMMENT SECTION * * DATE 1996-05-15 EMBEDDED COBOL LANGUAGE * 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. * * DML179.PCO * WRITTEN BY: David Flater * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests Intermediate SQL. * * REFERENCES * FIPS PUB 127-2 14.2 Intermediate SQL * ANSI SQL-1992 * ****************************************************************
01 longst-value. 02fillerpic x(71) value"INSERT INTO T0892 (INTKEY, NAAM,
- " ADDRESS, KEYWORDS, DESCRIPT3) VALUES (". 02fillerpic x(71) value"0, 'John". 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(52) value"
- " Smith', ". 02fillerpic x(68) value"'1313 Osprey Alley". 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) value"Box 35B Sector 28 Quadrant 3". ". 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) value"Rural Route 29837-39234234324-XR
- "Z". 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(68) value"Beverly Hills, CA". 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespaces. 02fillerpic x(52) value"
- " 90210', ". 02fillerpic x(68) value"'aardvark osprey metrol
- "gy".
lerpic x) spacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 02fillerpic x(68) valuespaces. 02fillerpic x(68) value"synthetic
- "P". 02filler* COMMENT SECTION 02fillerpic* DATE 1996-05-15 EMBEDDED COBOL LANGUAGE
- " quadruped cattle". 02fillerpic x( * This program was written by employees of NIST to test SQL 02fillerpic* FIPS PUB 127-2 14.2 Intermediate SQL
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 02filler01PIC()COMP. fillerpic (68 spacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 02fillerpic x( uidx X18. 02fillerpic x(68) value"java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 31 02fillerpic x(68) valuespaces. 02fillerpic x(68) valuespacesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 fillerpic() value"java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
- " gravity',". 02pic x()value"filler filler blah
- " x() value ",'ohn. 02fillerpic x(68) valuespaces02 x68valuespaces. spaces. 02fillerpicx) spaces. fillerpic x()value . 02fillerpic (68value . 02fillerpic x(68) valuespaces. 02fillerpic x(68) 02filler )valuespaces. filler x68valuespaces. pic x68)spacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 02fillerpicx()valuespaces.
x68) . 02fillerpic x02filler x()value 02 02 fillerfillerpic() "1313 Alley"java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
).
01 norm1 PIC S90268" .
norm2S9 SIGNSEPARATE 01 ALPNUM-TABLE 02 filler pic xspaces 789" 05 -""java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 01 . 05 NORMSQXX OCCURSTIMES. 01errcnt S99DISPLAYSEPARATE *date_time declaration 01 TO-DAY 02 filler x52)value java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 01 THE-TIME 02 filler (68)value"aardvark osprey java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 01 flag 02 fillerpic()valuespaces
01 SQL-COD PIC S9(9) DISPLAYSIGN"
PROCEDUREfillerx68) gnuyak
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
MOVE"FLATER02picx) value"CORBAIDLAmste CALL" - "rdam""rdam". MOVE"not logged in, not"TO uidx
USER :idx FROM HU.CCOEND-EXEC MOVESQLCODETO SQL-COD SQLROLLBACK WORK END-EXEC 02picx68) java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 if (uid NOT = uidx) then DISPLAY"ERROR: User ", uid, " java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 46
- " connected 02 filler pic x(68) value spaces. STOPRUN END-IF 0TO errcnt
DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, dml179.pco - "lah. DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print ACCEPT 02 filler filler x()valuespacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 ACCEPT THE-TIME FROMTIMEspacesjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 fillerpicx( valuespaces.
******************** BEGIN TEST0892 ******************* MOVE1TO02fillerpic (65 valuespaces.
DISPLAY" FIPS " sizing = 8000,statement >java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 4000" DISPLAY"References:" DISPLAY" FIPS 16.6 -- Sizing #27, Length of a row" DISPLAY" "ABCDEFGH56789IJKLMNOPQRSTUVWXYZ "statement >java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 DISPLAY" FIPS 166-- #,CHARACTER
- " length" DISPLAY" - ----------- --- -- "
*date_time declaration
xx SQLSTATE
*twice the number of columns 18 *length of char strings 7978 *decimal precision plus 1 of each exact numeric column 4
DISPLAY"CREATE TABLE T0892 (" DISPLAY" INTKEY NUMERIC 3 PRIMARY KEY,
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0 DISPLAY" ADDRESS VARCHAR (1000)," DISPLAY" KEYWORDS VARCHAR (1000)," DISPLAY" FUNCTION1 VARCHAR (1000)," DISPLAY" FUNCTION2 VARCHAR (1000)," DISPLAY" DESCRIPT1 VARCHAR (1000)," DISPLAY" DESCRIPT2 VARCHAR (1000)," DISPLAY" DESCRIPT3 VARCHAR (978));" EXECSQL CREATE TABLE MOVESQLCODETO
INTKEY NUMERIC (3) SQLCODE SQL-COD
NAAM (1000), ADDRESS VARCHAR "RROR:User" , expected.User" uidx,java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
()java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
FUNCTION1 VARCHAR (1000
FUNCTION2 "SQL Test Suite, V6EmbeddedCOBOL,dml179.co 59byteID
DESCRIPT2 VARCHAR (1000),
DESCRIPT3 VARCHAR (978)) END-EXECACCEPT TO-DAY FROM
TOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 PERFORM"FIPS " DISPLAY" "
DISPLAY"WORK;java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
COMMIT END-EXEC MOVESQLCODETODISPLAY"FIPS 166- Sizing#27 Length of a row" PERFORM CHCKOK " "
MOVE longst-value TO longst DISPLAY"The java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 66 " - - --- - ---- DISPLAY longst
DISPLAY java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "xxxx"TO
*twice the number of columns 18 PERFORM CHCKOK DISPLAY" "
DISPLAY"UPDATE T0892" DISPLAY FUNCTION1 = DISPLAY"INTKEY NUMERIC ()PRIMARY KEY,"
- " of the '" DISPLAY"'Materials '" DISPLAY"'Blasting Laboratory in the National Cattle
- "Acceleration '" DISPLAY"'Project of '" DISPLAY"' DISPLAY " KEYWORDSVARCHAR (1000),"
- DISPLAY"FUNCTION1 (1000),java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 DISPLAY DESCRIPT1 (1000)" DISPLAY978)
-" of'java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 DISPLAY"'materials '" DISPLAY"'usedinthetrebuchet. He served ten years as
- " the '" DISPLAY VARCHAR(000, DISPLAY FUNCTION1 1000)
thejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 "Pennsylvania' DISPLAY VARCHAR 978)END-EXEC
- " '" DISPLAY"'java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY"'as a world-class graffiti artist and source of
- " all good '" DISPLAY"' MOVE SQLCODE T DISPLAY' in poorweather.He is
-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY T statementa DISPLAY"'paperback novels, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 34
- DISPLAY"Pumpkinswill Fit ' DISPLAYEXEC :
-"Useless Things 'java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 DISPLAY"that Don't' DISPLAY"'Want java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0 " DISPLAY"'Head without '" ' worksRedundancy
-"of 'java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 ' ' DISPLAY"'java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 28
- " DISPLAY lower jobto the
DISPLAYjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 36
- java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 26 DISPLAYDISPLAY' intrebuchet served
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 43
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30
Harry inthejava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 67 ' java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 'Acceleration "' ' tojava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 61
- "all 'java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 'correlate the loft and acceleration "to poor weather. isis 'quality of DISPLAY "'ten thousand ' the trebuchet. served ten ' 'as the java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 20 'charge of marketing in the now "the ofa ,""A java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65 ' of ' 'java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 64 DISPLAY'without'java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 ' 'all good bits related ' 'to ANSI 'java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 'authorof ten java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 'paperback novels, java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 33 'Pumpkins will Fit ' 'on the Head of a Pin," "A Whole Bunch of Useless '
SPLAY"WHERE INTKEY = 0;" 'Want to Know," and "How to Lift Heavy Things ' 'Over yourHeadwithout ' 'Hurting Yourself or Dropping Them." He attends ' andISO standards ' 'meetings in his copious free time and funds the '
'suites with his 'fthe Materials java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 WHERE INTKEY =0END-EXEC MOVESQLCODETO SQL-COD AccelerationProjectofjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 PERFORMCHCKOK DISPLAY correlate and versus java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
DISPLAY"UPDATE T0892" DISPLAY" SET 'trust of the Pennsylvania DISPLAY"DESCRIPT1 = FUNCTION1," DISPLAY" DESCRIPT2 = FUNCTION1," DISPLAY" DESCRIPT3 = SUBSTRING (FUNCTION1 FROM 1 FOR
- " 978);" EXECSQL UPDATE T0892 SET FUNCTION2 = FUNCTION1,
DESCRIPT1 = FUNCTION1,
DESCRIPT2 = FUNCTION1,
DESCRIPT3 = SUBSTRING (FUNCTION1 FROM1FOR978) END-EXEC MOVE'aperback ,including such ' PERFORM' theHead Pin" " WholeBunch Useless ' DISPLAY" "
MOVE0TO int1 DISPLAY"SELECT CHAR_LENGTH (NAAM) +java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 DISPLAY" CHAR_LENGTH Hurting Yourself or Dropping Them. He attends ' DISPLAY" CHAR_LENGTH (KEYWORDS) +" DISPLAY" CHAR_LENGTH (FUNCTION1) +" DISPLAY" java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 47 DISPLAY" CHAR_LENGTH (DESCRIPT1) +" DISPLAY" CHAR_LENGTH (DESCRIPT2) +" DISPLAY" CHAR_LENGTH (DESCRIPT3 PERFORM CHCKOK DISPLAY" INTO DISPLAY" FROM DISPLAY " SET FUNCTIO = FUNCTION1," DISPLAY" WHERE INTKEY = 0;" EXECSQLSELECT CHAR_LENGTH (NAAM) +
(DDRESS+
CHAR_LENGTH (KEYWORDS) +
CHAR_LENGTH (FUNCTION1) +
CHAR_LENGTHSQL T0892
()+
(DESCRIPT2+
=,
DESCRIPT3=SUBSTRING(UNCTION1FROM1978) FROM T0892 SQLCODE SQL-COD
EY=0 MOVESQLCODETO SQL-COD
int1shouldbe8000;valuejava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 63 if (DISPLAY Ajava.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 62 MOVE0TO flag END-IF
DISPLAY java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 64 SQL WORK MOVESQLCODETO SQL-COD PERFORM CHCKOK DISPLAY" "
ifTOSQL-COD DISPLAY" *** pass *** " EXECSQLINSERT if (int1 NOT = 8000) END-IF MOVESQLCODETO SQL-COD else DISPLAY"dml179. ** fail **" EXECSQLINSERTINTO HU.TESTREPORT
VALUES('0892','fail',' EXEC SQLDROP TABLE T0892 CASCADE MOVESQLCODETO SQL-COD COMPUTE java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 25 END-IF
"========================="
EXECSQLCOMMIT WORK END-EXEC MOVESQLCODETO java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 25 ******************** END TEST0892 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN.
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK. DISPLAY"SQLCODE should be 0; its value is ", SQL-COD DISPLAY"SQLSTATE should be 00000; its value is ", SQLSTATE
NOSUBCLASSTHRU if (SQLCODEelse 0 END-IF if (NORMSQ = "00000" (0892,fail'PCO)END-EXEC then DISPLAY"Valid implementation-definedEND-IF 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
*subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING java.lang.StringIndexOutOfBoundsException: Range [62, 32) out of bounds for length 62 if (NORMSQX DISPLAY"Valid implementation-defined SQLSTATE accepted.java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 MOVE"0"TO*subclasses with 000. This replacement equates valid 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 = *subclass begins in position 3 of char array NORMSQ GOTO EXIT-NOSUBCLASS END-IF
MOVE4TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 if (NORMSQX(norm1 *so proceed to zero it out, if valid (0-9,A-Z) MOVE""TONORMSQX(orm1 END-IF END-PERFORM
MOVE5TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING*examining position 4 of char array NORMSQ ifVARYINGFROM1BY1UNTILnorm2>java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
NORMSQX) 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" (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TOMOVE"0"TO NORMSQXnorm1) 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 und die Messung sind noch experimentell.