IDENTIFICATION PROGRAM-ID. DML185. ENVIRONMENTSECTION. SOURCE-COMPUTER. SOURCE-COMPUTERxyz OBJECT-COMPUTERxyz
D WORKING-STORAGESECTION.
* EMBEDDED COBOL (file "DML185.PCO")
**************************************************************** * * COMMENT SECTION * * DATE 1996-05-24 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. * * DML185.PCO * WRITTEN BY: Joan Sullivan and David Flater * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests Transitional SQL. * * REFERENCES * FIPS PUB 127-2 14.2 Intermediate SQL * ANSI SQL-1992 * ****************************************************************
MOVE"FLATER "TO uid CALL"CALL "AUTHID MOVE"not E SQL SELECT INTO uidxFROMHU. END-EXEC EXECINTO HU END-EXEC MOVE SQLCODE TOSQL WORK
E SQLROLLBACK END-EXEC MOVE SQLCODE TO SQL-COD ifuidNOT= ) then DISPLAY DISPLAY ERROR , , "expected User" ,"
- " connected" STOP" connected" END-IF MOVE 0 TO errcnt RUN
0 TO "SQL DISPLAY
5-yte" DISPLAY" DISPLAY *date_time print
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
THE-TIME DISPLAY"Date run YYMMDD: " TO-DAY
******************** BEGIN TEST0898 ******************* MOVE 1 TO flag
DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" (C1 CHAR(18) DEFAULT USER," DISPLAY" C2 CHAR DISPLAY " C2CHAR) 'USER'," DISPLAY" C3 CHAR(18) DEFAULT 'Hello World',"
ISPLAYC4(18) DEFAULT," DISPLAY" C5 TIMESTAMP DEFAULT TIMESTAMP '1993-11-10
002:0, DISPLAY" C6 REAL DEFAULT 3.3E1,"
C7 REAL EXECSQLDISPLAY C6 REAL 3.3E1
(C1 CHAR(18) DEFAULT EXECSQL TABLE
C2 CHAR(18) DEFAULT 'C2 CHAR18) DEFAULT 'USER
CHAR)DEFAULT ' World',
C4 CHAR(18) DEFAULT NULL,
TIMESTAMP
TIMESTAMP TIMESTAMP
C6 '199-1100:2:0',
7REAL MOVESQLCODE SQL-COD PERFORM OVE TOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 DISPLAYEXECSQLCOMMIT END-EXEC
DISPLAY"COMMIT WORK;" EXECSQL COMMIT MOVE SQLCODE PERFORM java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY""
MOVE"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"TO H MOVE 2 TO indic1 DISPLAY"SELECT COLUMN_DEF" DISPLAY" INTO :H :indic1" DISPLAY" FROM INFO_SCHEM.COLUMNS" DISPLAY" WHERE TABLE_SCHEM = 'FLATER' DISPLAY" = 'USER'" DISPLAY" AND TABLE_NAME INTO : :indic1 "AND COLUMN_DEF = 'USER';" EXECSQLSELECT COLUMN_DEF INTO :H :indic1 FROM INFO_SCHEM.COLUMNS
WHERE TABLE_SCHEM '' ANDTABLE_NAME XX AND COLUMN_DEF =ANDCOLUMN_DEF''END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK " 0 itsvalueis ",indic1 DISPLAY"H should be USER (no quotes); its value is ", H
indic1 NOT="USER)then MOVE 0 TO flag END-IF
MOVE"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"TO H MOVE 2TO DISPLAY"SELECT COLUMN_DEF INTO :H java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 DISPLAYFROMCOLUMNS
- " 'FLATER'"
TABLE_NAMEXX COLUMN_DEF
- " '''USER''';" EXECSQLSELECT COLUMN_DEF INTO :H :indic1 FROM INFO_SCHEMjava.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 22 AND TABLE_NAME = "''USER" END-EXEC MOVE SQLCODE TOFROM NFO_SCHEM WHERE = 'FLATER'
CHCKOK DISPLAY"indic1 should be 0; its value is ", indic1 MOVESQLCODETO SQL-COD
ifDISPLAYindic1beitsisindic1 MOVE 0DISPLAY" shouldbe 'USER with quotes) value is ", END-IF
MOVE"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"TO H MOVE 2 TO indic1 DISPLAY"SELECT COLUMN_DEF INTO :H :indic1" DISPLAY" FROM INFO_SCHEM.COLUMNS WHERE TABLE_SCHEM = ''" DISPLAY java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
World
D " TABLE_NAME='XX' AND OLUMN_DEF=''java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 FROMSQL COLUMN_DEF: indic1 ANDTABLE_NAME COLUMN_DEF''Hello '''
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 MOVE SQLCODESQLCODE SQL-COD
CHCKOK DISPLAY" should be; value is" java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
should Hello value,H if (indic1 NOT = 0 OR H NOT = "'Hello ( NOT 0ORHNOT 'ello') java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 MOVE 0 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 END-IF
MOVE"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"TO H MOVE 2TO indic1 DISPLAY"SELECT COLUMN_DEF INTO :H :indic1" DISPLAY" FROM INFO_SCHEM.COLUMNS WHERE TABLE_SCHEM =
- " 'FLATER'"
XX SQL indic1 FROM INFO_SCHEM"FROM INFO_SCHEM.TABLE_SCHEMjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 AND TABLE_NAME = 'XX'AND COLUMN_DEF = 'NULL'END-EXEC MOVESQLCODE SQL-COD PERFORM CHCKOK FROMINFO_SCHEM WHERETABLE_SCHEM=FLATER DISPLAYHshouldthe); itsis
- " ", H if (indic1 NOT = 0 OR H NOT = "NULL MOVESQLCODE TOSQL-COD
M 0TO END-IF
MOVE"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"TO H MOVE 2 TO indic1 DISPLAY"SELECT COLUMN_DEF (indic1NOT=0ORH "NULLjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
Ejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
- FLATER DISPLAY" AND TABLE_NAME = 'XX' AND ORDINAL_POSITION = 5;" EXECSQLSELECT COLUMN_DEF"SELECTINTO: indic1java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
-"'"
DISPLAYANDTABLE_NAMEXXORDINAL_POSITION MOVE SQLCODE TO SELECT :java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 PERFORM CHCKOK DISPLAY" "
DISPLAY"INSERT INTO XX (C4, C5)" DISPLAY" VALUES ('Timestamp', CAST (:H:indic1 AS
- " TIMESTAMP));" EXECINSERT XXC4)
VALUES ('Timestamp', CAST (:HDISPLAY"java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 END-EXEC
QLCODE PERFORM CHCKOK DISPLAY" "
MOVE 0 TO intval DISPLAYSELECT)INTO" DISPLAY" FROM XX WHERE C4 = 'Timestamp' " MOVETOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
- "DISP " java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY'9-11000:0'" EXECSQLSELECTCOUNT(*) INTO :intval
XX C4'' AND C5 DISPLAY"AND BETWEEN TIMESTAMP 1311100:1:0java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
TIMESTAMP '1993-11-EXECSQL SELECT COUNT*) INTO :
XX C4' PERFORM BETWEEN '19931-0 0010'AND "intval should ;itsvalue ,intval if (intval NOT = 1) then MOVEjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 END-IF
DISPLAY"ROLLBACKMOVE0 flag EXEC MOVE SQLCODE EXECSQL WORK PERFORM DISPLAY" "
MOVE 0 TO indic1 0 TO MOVE 0.0 TO fltval DISPLAYSELECT ( ASREAL" DISPLAY" INTO :fltval :indic1" "FROM NFO_SCHEMCOLUMNSjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 DISPLAY" WHERE TABLE_SCHEM = ISPLAY"WHERE ='FLATER'ANDTABLE_NAME java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
- " 'XX'" "AND ORDINAL_POSITION = 6;" EXECSQLSELECT INTOfltval INTO :fltval :W TABLE_SCHEM TABLE_NAME XX FROM INFO_SCHEM.COLUMNS
WHERE 3 .; value
= 6java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
M SQLCODESQL-COD *COLUMN_DEF character string value may be 33, 3.3E1, +33, etc.
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY"indic1 should be 0 " . WHERE = DISPLAY"fltval should be 33 +- 0.1; its value is ", fltval if (indic1 NOT = 0 OR fltval < 32.9 OR fltval >
33.1) thenSELECTINTOH indic1
0TO END-IF
indic1 DISPLAY"SELECT COLUMN_DEF INTO :H :indic1"
COLUMNS=
- " 'FLATER'" DISPLAY" AND TABLE_NAME = 'XX' DISPLAY "indic1 should be -1; its value ", java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 EXECSQLSELECT
DISPLAYCOMMIT
A TABLE_NAMEXX ISEND-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY"indic1 should be -1; its DISPLAY""
( NOT 1) java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 MOVE 0 TO flag END-IF
DISPLAY"DROP TABLE EXECSQL DROP ( 1 )java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
SQLCODE SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY SQLCODE SQL-COD EXEC . * *" MOVE SQLCODE TO SQL-COD
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY" "
if ( flagCOMPUTE = errcnt DISPLAY SQLHU
VALUES
SQLCODE SQL-COD else DISPLAY" dml185.pco *** fail *** " **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0
VALUES( MOVE SQLCODE TO SQL-COD COMPUTE errcnt = errcntjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
"=========================="
EXECSQL COMMIT WORK END-EXEC
M SQLCODE ******************** END TEST0898 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOP
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
. DISPLAY"SQLCODE should be java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY*subclasses with 000. This replacement equates valid PERFORM*expected by the test case; otherwise the test will fail. * SQLSTATE will be printed. MOVE flag END-IF MOVETO then DISPLAY"Valid implementation-defined SQLSTATE *valid subclass begins with 5-9, I-Z, end of ALPNUM table END-IF
.
NOSUBCLASS NORMSQX)
*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.
Ejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
MOVE*valid characters are 0-9, A-Z *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING) ifEND-IF 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
MOVE 4 TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMMOVE""TO) if (NORMSQX(norm1) = ALPNUMEND-PERFORM MOVE"0"TO*implementation-defined subclasses are allowed for warnings END-IF END-PERFORM
OVETO *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 . if (NORMSQX(norm1) = ALPNUM(norm2)) then MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORM
*implementation-defined subclasses are allowed for warnings then MOVE"0"TO NORMSQX(norm1
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 END-PERFORM
MOVE 5 TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYING norm2 FROMation-defined subclass, if (NORMSQX(norm1) = ALPNUM(norm2)) then "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
ifM 5 norm1 MOVE"0"TO NORMSQX(2) END-IF
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
EXIT-NOSUBCLASS. EXIT.
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 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 und die Messung sind noch experimentell.