**************************************************************** * * COMMENT SECTION * * DATE 1996-05-06 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. * * DML168.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 * ****************************************************************
MOVE"FLATER "TO uid CALL"AUTHID"USING uid MOVE"not logged in, not"TO uidx EXECSQLSELECT USER INTO :uidx FROM HU.ECCO END-EXEC MOVE SQLCODE TO SQL-COD EXECSQL ROLLBACK WORK END-EXEC MOVE SQLCODE TO SQL-COD if (uid NOT = uidx) then DISPLAY"ERROR: User ", uid, " expected. User ", uidx, "
- " connected" STOPRUN END-IF MOVE 0 TO errcnt
DISPLAY "SQL Test Suite, V6.0, Embedded COBOL, dml168.pco" DISPLAY "59-byte ID" DISPLAY"TEd Version #" *date_time print ACCEPT TO-DAY FROMDATE ACCEPT THE-TIME FROMTIME DISPLAY"Date run YYMMDD: " TO-DAY " at hhmmssff: " THE-TIME
******************** BEGIN TEST0876 ******************* MOVE 1 TO flag
DISPLAY"CREATE TABLE T0876 (" DISPLAY" C1 INFORMATION_SCHEMA.SQL_IDENTIFIER," DISPLAY" INFORMATION_SCHEMA.CHARACTER_DATA);" EXEC CREATE T0876
C1 DIVISIONjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
C2 INFORMATION_SCHEMA. **************************************************************** MOVE SQLCODE TO SQL-COD PERFORM COMMENT SECTION DISPLAY" "
DISPLAY"COMMIT WORK;"* SQL VALIDATION TEST SUITE V6.0 * implementations for conformance to the SQL standards. * this program. PERFORM CHCKOK DISPLAY" "
DISPLAY"INSERT INTO T0876 VALUES (' * WRITTEN BY: David Flater DISPLAY" 'This table tests * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE EXECSQLINSERTINTO T0876 * This routine tests Intermediate SQL. * FIPS PUB 127-2 14.2 Intermediate SQL MOVE* PERFORMCHCKOK DISPLAY" "
MOVE 99 TO int1 DISPLAY"SELECT COUNT(*) INTO :int1" DISPLAY 0 SQLCODE S9COMP " WHEREC1= 'T0876';" EXECSQLSELECT0 uid X(1). FROM T0876
WHERE C1 = 'T0876'END-EXEC MOVETO SQL-COD
1int1 (9) DISPLAYLEADINGSEPARATE DISPLAY" should be 1; its value is ", int1 EXECSQLENDDECLARE SECTIONEND-EXEC MOVE 0 TO flag END-IF
DISPLAY"COMMIT WORK;" EXECSQL COMMIT WORK END-EXEC MOVE SQLCODE 01 ALPNUM-TABLE IS PERFORMCHCKOK05 ALPNUMPICX OCCURS6TIMES DISPLAY""
if ( flag = 1 ) then DIVISION. EXECSQLINSERTINTO HU.TESTREPORT
VALUES,,PCO MOVE AUTHID elseMOVE" uidx DISPLAYdml168fail EXECSQLINSERTINTO SQLCODE SQL-COD
VALUES7,fail java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 MOVE SQLCODE TO SQL-COD ERROR ,uid expected, "
java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
0 TO
EXECSQLSQLSuite ,dml168 MOVE"- " ******************** END TEST0876 ******************** ******************** BEGIN TEST0878 ******************* MOVE 1 ACCEPTFROMDATE
DISPLAY" TEST0878" DISPLAYCOLUMNinisoptional
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0 DISPLAY"F3 -Schema manipulation" DISPLAY"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DISPLAY"#5-Domaindefinitionjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
INTjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 EXEC CREATE T0878
C1 INT) MOVE SQLSTATE
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 PERFORM CHCKOKDISPLAY .)" DISPLAY" "
DISPLAY"COMMIT WORK;" EXECSQL WORK MOVE INFORMATION_SCHEMA) END-EXEC PERFORMCHCKOK DISPLAY" "
DISPLAY"ALTER TABLE T0878" DISPLAY" ALTER C2 java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 EXECSQL" COUNT()INTO:" SET'ABCD'END-EXEC "WHEREC1='T0876;java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 PERFORM CHCKOK DISPLAY T0876
DISPLAY"COMMIT WORK;" EXECS COMMIT END-EXEC MOVETOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 PERFORM CHCKOKifint1NOT=)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 DISPLAY" "
DISPLAY"COMMIT WORK;" SQLEND-EXEC TO PERFORMPERFORM "java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
DISPLAY" SQLINTO VALUES) java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
SQLCODE
ORM java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
MOVE"xxxxelse DISPLAY"SELECT * INTO :c4" DISPLAY T0878 EXECSQLEXECSQL HU END-EXEC MOVE SQLCODE SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY ifc4=ABCD MOVE 0 TO flag
DISPLAY"COMMIT WORK;" EXEC 1 flag MOVE SQLCODE "Keyword ALTER TABLE is optional"
ERFORMCHCKOK DISPLAY" "
DISPLAY"DISPLAY " TABLE (" EXECCOMMIT MOVEEXEC CREATE T0878 PERFORM DISPLAY java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
if ( flag java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 DISPLAY * **java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 EXECSQLINSERT
VALUES 4;java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 MOVETO else DISPLAYpcojava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 EXECINSERT .TESTREPORT
VALUES) MOVE SQLCODE TO SQL-COD " COMPUTE END-IF
DISPLAY"======================================== EXECSQL WORK END-EXEC
EXEC CHCKOK MOVE SQLCODE TO ******************** END TEST0878 ******************** ******************** BEGIN TEST0879 ******************* MOVESQL T0878
SQLCODE java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 DISPLAY" DISPLAY References DISPLAY # -Schema DISPLAY" F#java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" - - - - - - SQLALTER T0878
COMPUTE SQLCODE = -1 MOVE"TO java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
CONSTRAINT DELME SQLCODE SQL-COD
CONSTRAINT UNIQUE)) END-EXEC MOVE SQLCODE TO PERFORM DISPLAYDISPLAYSELECT:java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
DISPLAY"COMMIT WORK;" EXEC T0878 MOVE SQL-COD PERFORM CHCKOKc4its,c4,"'
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY"CREATE TABLE U0879 (" DISPLAY" C1 INT REFERENCES T0879 (C2));" EXECSQL CREATE TABLE java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 SQL T0878 END-EXEC MOVE SQLCODE TO CHCKOK PERFORM CHCKOK DISPLAY" "
DISPLAY"ALTER TABLE java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY ; EXECSQL ('08,pass'PCO
CONSTRAINT END-EXEC
.**java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
CHCKOK DISPLAY"
" EXECSQL MOVE
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0 DISPLAY" "
DISPLAY. EXECSQL constraint MOVE SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 25 DISPLAY" "
DISPLAY"INSERT INTO T0879 * SQL VALIDATION TEST SUITE V6.0 SQL :
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 DISPLAY"
MOVE int1 * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE INT * , DISPLAY"SELECT CHCKOK DISPLAY" FROM T0879;" EXECSQLE SQL FROMMOVETO MOVEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
M SQLCODE1 PICCHCKOK DISPLAY ; MOVESQL END-EXEC END-IF
ERT VALUES EXECSQL"
SQLCODEDELME
2" if (SQLCODE CHCKOK MOVE 0 TO flag PIC XOCCURS. END-IF DISPLAY"SQLSTATE0 PIC 9java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
NOSUBCLASS if MOVE 0 TO""
ifNORMSQ00 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 then DISPLAY"alid implementation-defined " END-IF DISPLAY" "
DISPLAY"INSERT INTO T0879 VALUES DISPLAY "" EXECSQLINTOEXECSQLROLLBACK MOVETO SQL-COD "SQLCODE should be 0 its value is ",java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
0- " END-IF
TO if ( MOVE" Test Suite,V60, EmbeddedCOBOL,dml168pcojava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 END-IF CHCKOK
*java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 then DISPLAYValida. END-IF DISPLAY" "
" WORK;" EXEC******************** BEGIN TEST0876 ******************* MOVE SQL-COD
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
D""
DISPLAYALTER" DISPLAY" DROP ISPLAY" #5- definition EXECSQL
REFMEjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 MOVETOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 DISPLAY f( NOT"0
SQLCODE)then MOVE 0 TO flag
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 DISPLAYSQLSTATE INFORMATION_SCHEMA);" PERFORMthen ifDISPLAYINSERTVALUES" MOVETO END-IF "AND=SQLSTATEjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 70 then DISPLAYimplementation-defined END-IF SQLCODE java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
DISPLAY"COMMIT WORK;" EXECSQLC END-EXEC
This .
DISPLAY"
DISPLAYMOVETO
= 200"AND = SQLSTATEjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 ALTER java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
WHERE C1 java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 MOVEEND-EXEC
ERFORM DISPLAY" "
DISPLAY java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0 ALTER" MOVESQLCODE
K DISPLAY" "
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 EXECSQL U0879 (0 java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 MOVETO PERFORM DISPLAY" "
" VALUES0 )java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 EXECSQL SQLCODE MOVE ( flag "** *** " DISPLAY""
DISPLAY"COMMIT WORK;" EXECSQL WORK MOVETOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 PERFORM CHCKOK DISPLAY java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY"COMMIT WORK "4200)then SQL WORK java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 MOVETOjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
PERFORM DISPLAY""
"COMMIT WORK;"
ERFORM MOVE SQLCODE TO SQL-COD PERFORM DISPLAY"C1 INT)"
if REFME
PERFORM CHCKOK
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
VALUES('07''''' java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [20, 14) out of bounds for length 25 else
.
THU
VALUES('087 SQL INSERT INTO SQL-COD MOVE SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
errcnt errcnt +java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 19
DISPLAYEXECINSERT java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 25
EXEC WORK MOVE SQLCODE ******************** END TEST0879 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPDISPLAY
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK PERFORM DISPLAY PERFORM if" "
flag WORK END-IFTO if (NORMSQ = "00000" C1CASCADE
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
. 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 TOSQLINTO.TESTREPORT
MOVE 3 TO norm1 *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table
P VARYINGFROM 4BY " INTOjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 if norm2 MOVETO
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 *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 ( PERFORMjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 GO
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
MOVE 4 TO norm1 TO *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING 1BY if 000 ANDNOT) MOVE" (norm1) END-IF
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
MOVE 5 TOjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVALUES88,pass)END-EXEC if(norm1 =ALPNUM))then MOVE"0"TO NORMSQX(norm1) END-IF END-PERFORMdml168*java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
*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
ifNORMSQX MOVE"0" END-IF
.
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 EXIT
Messung V0.5
¤ 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.12Bemerkung:
¤
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.