Quellcode-Bibliothek dml140.cob
Interaktion und PortierbarkeitCobol
IDENTIFICATIONDIVISION. PROGRAM-ID. DML140 * the dynamic version of DML139. ENVIRONMENTDIVISION. CONFIGURATIONSECTION. SOURCE-COMPUTER. xyz. OBJECT-COMPUTER. xyz. DATA* FIPS PUB 127-2 14.1 Transitional SQL WORKING-STORAGESECTION.
* EMBEDDED COBOL (file "DML140.PCO")
**************************************************************** * * 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. * * REFERENCES * FIPS PUB 127-2 14.1 Transitional SQL * ANSI SQL-1992 * ****************************************************************
EXECSQL 1 PIC S99 SIGNSEPARATE
01 SQLCODE PIC(9) COMPjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
1 PIC X5.
01 uid PIC X(18).
01 uidx PIC 1TO-DAY PIC9(6.
01 dstmt PIC X(50).
01 longst PIC X(240). EXECSQLEND DECLARE SECTIONEND-EXEC
01norm1 S9) DISPLAYSIGNSEPARATE
01 norm2 PIC S9 1 flag S9 SIGNSEPARATE
1ALPNUM-TABLE IS
DIVISIONjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
0 PIC X 36 TIMES
01 NORMSQ.
05 NORMSQX X 5 .
01 errcnt PIC S9(9) DISPLAYCALLAUTHID uid *date_time declaration
01 TO-DAY PICEXECSQL USER INTOuidx HU END-EXEC
01 THE-TIME PIC 9 MOVE SQLCODE SQL-COD
01 flagPIC(9) DISPLAYLEADINGSEPARATE
01 SQL-COD SQLCODETO SQL-COD
DIVISION. ": User , "expected,uidx
MOVE connected CALL"AUTHID"USING uid MOVEjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 EXECSQLSELECT MOVE SQLCODE SQL Suite. COBOLdml140 EXECSQL WORK END-EXEC
SQLCODETO if (uid DISPLAYTEd # DISPLAY"ERROR: CCEPTTO-DAY FROMDATE
- " connected" STOPRUN END-IF MOVE 0 TO errcnt
******************** BEGIN TEST0829 *******************
1 flag
DISPLAY" TEST0829 " DISPLAY < behavior> on a REVOKE (dynamic)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 DISPLAY":java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 DISPLAY #1- Dynamic" DISPLAY" F# 3 -- Basic schema java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 DISPLAY" 11.2 java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 DISPLAY"1137 --" DISPLAY" - - - - - - - - - - - - - - - - - - -"
COMPUTE SQLCODE = -1 MOVE"xxxxx"TO*If it is rejected at compile time, save the error and TEd it ou
*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
EXECSQLDELETEEXECINSERTINTO VALUES ( MOVETO EXECSQLINSERTINTO CONCATBUF HUFROMRESTRICT 'REVOKE GRANT OPTION FOR SELECT' OVE TO SQL-COD ' ONHU. FROM CUGINI RESTRICT'
) END-EXEC MOVE SQLCODE TO SQL-COD EXECSQLSELECTINTO :longst CONCATBUFEND-EXEC
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MOVEDISPLAY" IMMEDIATE :longst;" DISPLAYSQLEXECUTE :longst "SQLSTATE be 42000; its value is " shouldbe ;its is",SQL-COD PERFORM NOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODE NOT < 0 OR NORMSQ NOT = " DISPLAY "SQLSTATE be 4000 its is", SQLSTATE MOVE 0 TO END-IFifSQLCODE NOT<0 OR NORMSQ NOT= "4000) then ifMOVETO then DISPLAY" implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
DISPLAY"EXECUTE IMMEDIATE :longst;"
EXECUTE MOVE java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 PERFORM DISPLAY" SQL EXECUTE IMMEDIATE:longst END-EXEC
DISPLAY"ROLLBACK WORK;" EXECSQL ROLLBACK CHCKOK MOVETO SQL-COD PERFORMSQL WORK
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
*schema1 GRANT SELECT ON HU.WORKS TO CUGINI is not affected by * REVOKE SELECT ON HU.WORKS FROM PUBLIC
"" MOVE REVOKEWORKSjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 TO
*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 *If it is rejected at compile time, save the error and TEd it ou
- " RESTRICT"*schema4 - AUTHORIZATION SULLIVAN1 MOVE"REVOKE SELECT ON HU.STAFF FROM MOVE REVOKE SELECT ON .STAFF FROM PUBLICRESTRICT java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
ISPLAYIMMEDIATE;"
DISPLAY"EXECUTE IMMEDIATE :longst;" EXECSQL EXECUTE IMMEDIATE :longst END-EXECEXECSQL IMMEDIATE :longstEND-EXEC MOVE SQLCODE SQLCODE SQL-COD DISPLAY"DISPLAY"SQLCODEshould < 0; its is", java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
D SQLSTATE be4000;its is", SQLSTATE PERFORM NOSUBCLASS PERFORMNOSUBCLASS THRU EXIT-NOSUBCLASS if (SQLCODE NOT < 0 OR NORMSQ NOT = "42000") then (SQLCODE OT 0 ORNORMSQ NOT ="2000")then MOVE 0 TO flag END-IF if (NORMSQ =MOVE flag END-IF DISPLAY"Valid implementation-defined SQLSTATE accepted." END-IF DISPLAY" "
DISPLAY"ROLLBACK WORK;" EXECSQL ROLLBACK WORKjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 MOVE SQLCODE TO SQL-COD" PERFORM DISPLAY" "
DISPLAYMOVE"REVOKE SELECT ON HUPROJFROMPUBLICRESTRICT java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
-"RESTRICT""" MOVE"MOVESQLCODE TOSQL-COD
dstmt
EXECSQL COMMIT
OVE TO SQL-COD ******************** END TEST0829 ******************** **** TESTER MAY CHOOSE TO INSERT CODE FOR errcnt > 0 STOPRUN
* **** Procedures for PERFORM statements
*Test SQLCODE and SQLSTATE for normal completion.
CHCKOK ******************** END TEST0829 ******************** DISPLAY
java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 PERFORMPERFORM THRU EXIT-NOSUBCLASS ifSQLCODE =0ORNOT 000" then MOVE 0 TO flag END-IF MOVE0TO then DISPLAY"Valid implementation-defined SQLSTATE accepted."
.
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
*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*subclasses with 000. This replacement equates valid
MOVE 3 *expected by the test case; otherwise the test will fail. *subclass begins in position 3 of char array NORMSQ *valid subclass begins with 5-9, I-Z, end of ALPNUM table PERFORMVARYING norm2 FROM 14 BY 1 UNTILjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (NORMSQX MOVE""TO*subclass begins in position 3 of char array NORMSQ END-IF END-PERFORM if(norm1(norm2 java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 *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 = SQLSTATE GOTO EXIT-NOSUBCLASS END-IF
MOVE*examining position 4 of char array NORMSQ *examining position 4 of char array NORMSQ *valid characters are 0-9, A-Z PERFORMVARYING norm2 (NORMSQX) = (norm2)) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 if (NORMSQX(norm1) = ALPNUMEND-IF MOVE"0"TO NORMSQX(norm1) END-IFEND-PERFORM
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
MOVE 5 TO norm1 *valid characters are 0-9, A-Z *examining position 5 of char array NORMSQ VARYINGnorm2 1 BYUNTIL > 36 if (NORMSQX(norm1ifNORMSQX) = ALPNUMnorm2)) then
MOVE" 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
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 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.