**************************************************************** * * COMMENT SECTION * * DATE 1994/9/30 EMBEDDED COBOL LANGUAGE * NIST 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. * * DML140.PCO * WRITTEN BY: David W. Flater * TRANSLATED AUTOMATICALLY FROM EMBEDDED C BY CHRIS SCHANZLE * * This routine tests <drop behavior> in dynamic SQL. It is * the dynamic version of DML139. * OBJECT-COMPUTER. xyz. * FIPS PUB 127-2 14.1 Transitional SQL * ANSI SQL-1992 * ****************************************************************
EXECSQL BEGIN * COMMENT SECTION
01 SQLCODE * NIST SQL VALIDATION TEST SUITE V6.0
01 SQLSTATE * implementations for conformance to the SQL standards.
01 uid *
01 uidx PIC X(18) * This routine tests <drop behavior> in dynamic SQL. It is *
01 longst * FIPS PUB 127-2 14.1 Transitional SQL EXECSQLEND****************************************************************
0 norm1()DISPLAYLEADING.
01 norm2 SQLCODE S9.
01 ALPNUM-TABLE VALUEIS "01234ABCDEFGH56789IJKLMNOPQRSTUVWXYZ".
05 ALPNUM PIC X OCCURS 36 TIMES.
01 NORMSQ.
05 NORMSQX PIC X OCCURS 5 TIMES.
01 errcnt PIC S9(9) DISPLAY 0 SQLSTATE() *date_time declaration
0 TO-DAY ()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 PIC(9 LEADING.
0 PIC(9)DISPLAYLEADING.
DISPLAY " Test, V60,EmbeddedCOBOL, dml140.pco" DISPLAY ROLLBACK MOVE SQL-COD " Version" *date_time print
A java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 ACCEPT THE-TIME . .java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 DISPLAYrun: : "
******************** BEGIN TEST0829 *******************
1 flag
DISPLAYTEST0829 DISPLAY" YYMMDD: "TO-DAY THE-TIME DISPLAY"References: MOVE TO
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" F# 3 " droponREVOKE" DISPLAY" 11.2 FT.2 -- " DISPLAY" DISPLAY References" DISPLAY" "F - SQL
COMPUTE SQLCODE = -1 MOVE"xxxxx"TO SQLSTATE . java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
*The following violates 11.37 SR.18. *If it is rejected at compile time, save the error and TEd it ou *schema2 - AUTHORIZATION CUGINI - * grants SELECT ON HU.WORKS TO SULLIVAN
EXECSQL*If it is rejected at compile time, save the error and TEd it ou MOVE SQLCODE TO SQL CONCATBUF 'REVOKE GRANT OPTION FOR SQLCODE TO SQL-COD ' ON.WORKS CUGINI '
) END-EXEC
M SQLCODESQL-COD EXECSQLSELECT WORKS MOVE ZZ FROM
EXECUTE EXEC IMMEDIATE END-EXEC DISPLAYshouldis", SQLSTATE DISPLAYSQLCODE <0 value java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 DISPLAY should2; valueSQLSTATE PERFORM NOSUBCLASS THRU flag
( OR 4"
0 flag END-IF
Valid then DISPLAYSQLWORK
DISPLAY"
DISPLAYWORK EXECSQLCODE MOVESQLINTO VALUES TO
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY"ROLLBACK WORK;" EXECSQL ROLLBACK WORK END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"EXECUTE IMMEDIATE :longst;" EXECSQL :longst
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 PERFORM DISPLAYMOVESQLCODE
*schema1 GRANT SELECT ON HU.WORKS TO CUGINI is not affected by * REVOKE SELECT ON HU.WORKS FROM PUBLIC
-"RESTRICT"
- " RESTRICT""" MOVE"REVOKE SELECT ON HU.WORKS FROM PUBLIC RESTRICT " TO dstmt
dstmt
XEC IMMEDIATElongst MOVE SQLCODE SQL IMMEDIATE longst PERFORMMOVESQLCODE TO " java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
DISPLAY WORK MOVETO MOVETO PERFORM CHCKOK *The following violates 11.37 SR.18. DISPLAY*schema4 - AUTHORIZATION SULLIVAN1
*The following violates 11.37 SR.18. *If it is rejected at compile time, save the error and TEd it ou *schema4 - AUTHORIZATION SULLIVAN1 * - creates view MUL_SCH with SELECT from HU.STAFF
DISPLAY"dstmt=""REVOKE SELECT ON HU.STAFF FROM PUBLIC
- " RESTRICT""" "SELECTHUSTAFFFROM " TO dstmt
D "EXECUTE IMMEDIATE :longst;java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
EXECUTE java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 MOVETO
be valueSQL-COD DISPLAY"SQLSTATE should be 42000 ISPLAY" should 2 value
NOSUBCLASS java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 ifN < NORMSQ 400" java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
0TO
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 if then ROLLBACK END-EXEC DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
DISPLAY"ROLLBACK WORK;" EXECSQL ROLLBACK WORK END-EXEC MOVE SQLCODE TO SQL-COD PERFORM CHCKOK DISPLAY" "
DISPLAY"EXECUTE IMMEDIATE :longst;" EXEC- RESTRICT
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 PERFORM CHCKOK EXECUTE : END-EXEC "java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
if ( flag = 1 ) then
* ** java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 EXECINTO.java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
VALUES('0829','pass','PCO') MOVESQLCODE TO SQL-COD CODE SQL-COD else DISPLAY pco EXECSQLINSERTINTOVALUESfail
VALUES0'fail,' java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
SQLCODE COMPUTEjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0 END-IF
DISPLAY M SQLCODEjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
EXECSQL . MOVE* **** Procedures for PERFORM statements ******************** END TEST0829 ******************** **** 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
NOSUBCLASS EXIT-NOSUBCLASS
( NOT NORMSQ= "00) java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
flag
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 if (NORMSQ = "00000"AND then DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF
.
NOSUBCLASS *expected by the test case; otherwise the test will fail.
*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
MOVE 3 TO0 NORMSQX(norm1) *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING norm2
(NORMSQX) = ALPNUM))then 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) then GOTO EXIT-NOSUBCLASS END-IF
MOVE 4 TO norm1 *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 FROM 1 *valid characters are 0-9, A-Z if(norm1ALPNUMthen MOVE"0"TO NORMSQX(norm1)
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
MOVE 5 TO java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ PERFORMVARYINGPERFORMFROM 1 norm2
((norm1(norm2 MOVE"0java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 *(class = 01). These equate to successful completion 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. MOVE"0"TO NORMSQX(2) END-IF
.
EXIT-NOSUBCLASS. EXIT.
¤ 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.11Bemerkung:
¤
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.